Bug 400469 - Wrong character representation in file names with slash
Summary: Wrong character representation in file names with slash
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.51.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 421511 (view as bug list)
Depends on: 309192
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-30 08:00 UTC by Simone
Modified: 2020-06-06 11:53 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example of file name (1.48 KB, image/png)
2018-10-30 08:00 UTC, Simone
Details

Note You need to log in before you can comment on or make changes to this bug.
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".