Bug 400469

Summary: Wrong character representation in file names with slash
Product: [Frameworks and Libraries] frameworks-kio Reporter: Simone <s.scalabrino9>
Component: generalAssignee: David Faure <faure>
Status: REPORTED ---    
Severity: normal CC: a.samirh78, alexh.public+kde, bugs.kde, bugseforuns, elvis.angelaccio, kde, kdelibs-bugs, nate
Priority: NOR    
Version: 5.51.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on: 309192    
Bug Blocks:    
Attachments: Example of file name

Description Simone 2018-10-30 08:00:11 UTC
Created attachment 115975 [details]
Example of file name

When I use "/" in a file name, for example "test 1/2/3", the characters do not appear as they are intended (in the example, I see something like "test ½/3", see the attachment).

STEPS TO REPRODUCE
1. Create a new file with name "test 1/2/3"

OBSERVED RESULT
The file name is not rendered correctly (something similar to "test ½/3")

EXPECTED RESULT
The correct rendering would be "test 1⁄2⁄3", with the "⁄" character instead of "/". As an alternative, I would expect an error.

SOFTWARE VERSIONS
Distribution: Arch Linux
KDE Plasma Version: 5.14.2
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.2
Comment 1 Christoph Feck 2018-10-30 18:26:20 UTC
The slash character is forbidden in filenames, because it is the UNIX directory separator. It gets replaced with the 'fraction slash' (U+2044), which in turn causes the Qt rendering engine to render fractions, if there are digits to the left and the right of the slash.
Comment 2 Christoph Feck 2018-11-01 21:37:15 UTC
Could be replaced with 'division slash' (U+2215), which should not cause fraction composition, but could cause users getting unable to find their files.
Comment 3 Christoph Feck 2020-05-14 16:08:33 UTC
*** Bug 421511 has been marked as a duplicate of this bug. ***
Comment 4 Ahmad Samir 2020-05-31 10:19:58 UTC
I think the code should just disallow using '/' in file names, silently replacing it with the fraction slash is probably going to cause issues like the one reported here.

For dir names, the code in KNewFileMenu simply creates sub-dirs if it detects '/' in the name, and it informs the user about that.
Comment 5 David Faure 2020-06-06 11:53:08 UTC
The rendering as a fraction was never intended. I suggest we change this to division slash as suggested by Christoph.

This allows users to not hit restrictions with using some sort of '/' in filenames. Useful for "Documents / Files" and useful for URLs like "http://www.kde.org".