By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 269 - Forward slash allowed in file name
Summary: Forward slash allowed in file name
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdebase (show other bugs)
Version: 3.5.11 [Trinity]
Hardware: Other Linux
: P5 minor
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2010-09-14 15:24 CDT by John A. Sullivan III
Modified: 2013-05-09 10:34 CDT (History)
5 users (show)

See Also:
Compiler Version:
TDE Version String: 3.5.11 (Trinity)
Application Version: 3.5.10 using Trinity 3.5.12
Application Name: Konqueror File Manager


Attachments
Patch to replace slash with 'fraction slash' (2.09 KB, patch)
2012-11-19 18:15 CST, Darrell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John A. Sullivan III 2010-09-14 15:24:49 CDT
I do not know if this is technically a bug but it is causing confusion among our users.  If one chooses to rename a file in Konqueror, it is possible to include a forward slash in the name, e.g., my/file.pdf  As this is the directory delimiter, it is displayed elsewhere with an escape sequence, e.g, my%2ffile.pdf.  Should a forward slash be considered an illegal character when entering a file name int he Konqueror rename widget?
Comment 1 Timothy Pearson 2010-09-14 21:46:50 CDT
I would tend to agree that it should be an illegal character, however I need to do some searching to ensure that this is the correct POSIX way of handling the slash.  Out of curiosity, was this behaviour also present in the stock KDE 3.5.10?
Comment 2 John A. Sullivan III 2010-09-15 06:00:49 CDT
Yes, the user who first reported it was on stock 3.5.10 and then I confirmed the behavior is the same on my Trinity desktop.
Comment 3 Felix 2011-11-06 02:15:52 CST
I just ran into this on Trinity-based Konqueror (3.5.12 I think). I'm fairly sure this isn't a POSIX-inspired way of doing things; %2f is URL-escaping, and I suspect that it's related to Konqueror's web browser alter ego. I've never seen *anything* else translate %2f into '/' in filenames -- and that's why I agree that this feature needs to be changed.

It was changed in mainstream KDE4 (one of the few changes I agree with): Konqueror 4 will translate a typed / character into ⁄ (not sure if that's gonna show up...) -- Unicode char U+2044, 'FRACTION SLASH'.

This has the following advantages over the "%2f" behaviour:

- It's a single character.

- It displays correctly in anything that supports Unicode, including various terminal programs, and even Windows (I tested this over a Samba share; I imagine it would also work on a flash drive).

- It does what the user asked for -- I occasionally *do* want a slash in a filename, and for all intents and purposes 'fraction slash' is fine. I kind of like that it's distinct from the directory separator character, too.

~Felix.
Comment 4 ammo42 2011-11-22 22:52:17 CST
(In reply to comment #3)
> It was changed in mainstream KDE4 (one of the few changes I agree with):
> Konqueror 4 will translate a typed / character into ⁄ (not sure if that's gonna
> show up...) -- Unicode char U+2044, 'FRACTION SLASH'.
More precisely, the behaviour change is in the KIO::encodeFileName function from kdelibs/kio/kio/global.cpp. Using the KDE4 function should give the KDE4 behaviour. But I'd rather be careful before applying the patch because the function is also used on other parts of Trinity/KDE.
Comment 5 Darrell 2012-11-19 18:15:37 CST
Created attachment 1002 [details]
Patch to replace slash with 'fraction slash'

I created a patch to replace the slash in file names with a "fraction slash," unicode 0x2044. Conceptually simple, but the patch doesn't work as expected. When I type a keyboard slash in a file name the result in konqueror is a question mark.

Hopefully somebody knows why this happens and somebody also can test the patch on their system.
Comment 6 Timothy Pearson 2013-05-07 23:51:25 CDT
Fixed in GIT hash b4a2346.  The new code verifies proper Unicode support before attempting to use a Unicode slash (DIVISION SLASH) character instead of an HTML escape code.

Thanks for reporting!
Comment 7 Darrell 2013-05-08 12:34:27 CDT
Wow, that patch is slightly complicated. :-)

What is an appropriate way to test this?

With the patch applied, from within konqueror, when I now rename a file to include a forward slash, konqueror displays ?2f rather than a forward slash or %2f.

I am not able to rename a file using a forward slash from the command line or something like midnight commander because the forward slash is then correctly interpreted as a directory delimiter.

I'm using the latest GIT and Slackware 14,0, which to my knowledge is fully Unicode compliant.
Comment 8 Timothy Pearson 2013-05-08 13:13:00 CDT
(In reply to comment #7)
> Wow, that patch is slightly complicated. :-)
> 
> What is an appropriate way to test this?
> 
> With the patch applied, from within konqueror, when I now rename a file to
> include a forward slash, konqueror displays ?2f rather than a forward slash or
> %2f.
> 
> I am not able to rename a file using a forward slash from the command line or
> something like midnight commander because the forward slash is then correctly
> interpreted as a directory delimiter.
> 
> I'm using the latest GIT and Slackware 14,0, which to my knowledge is fully
> Unicode compliant.

Looks like an extra line of code snuck in; this is fixed in GIT hash d2f1ad1.

Once you have updated to the latest GIT, and based on the symptoms you described above, Konqueror will detect that your TDE session is not Unicode compliant and fall back to the %2f encoding.  One way to verify that your session is not Unicode compilant is to attempt to copy a Unicode character (e.g Korean, Hebrew, Chinese, etc.) from Wikipedia to a Konsole terminal session.  If the character shows up as a question mark, TDE is not using the Unicode features of your system.  Likely, your LANG environment variable will also be unset.

On Debian I needed to reconfigure locales and set en_US.UTF-8 as the default locale before TDE started using Unicode features.  Is there something similar on Slackware?
Comment 9 Darrell 2013-05-08 20:37:28 CDT
Oh, okay. Yes, Slackware recognizes the same en_US.UTF-8 and I needed that information to know how to test.

After changing that environment variable and restarting Trinity, I can rename a file using the forward slash.

To throw a pinch of sand in the gears: press F4 to open konsole to the same directory as the renamed file. Konsole does not display the forward slash. On my system the character is an "a" with a caret (Shift-6). I don't know whether that is important.
Comment 10 Timothy Pearson 2013-05-08 22:53:04 CDT
(In reply to comment #9)
> Oh, okay. Yes, Slackware recognizes the same en_US.UTF-8 and I needed that
> information to know how to test.
> 
> After changing that environment variable and restarting Trinity, I can rename a
> file using the forward slash.
> 
> To throw a pinch of sand in the gears: press F4 to open konsole to the same
> directory as the renamed file. Konsole does not display the forward slash. On
> my system the character is an "a" with a caret (Shift-6). I don't know whether
> that is important.

What is the output of "env | grep LANG" in the new Konsole window?  This sounds like the subject of a new bug report, not this one. ;-)
Comment 11 Darrell 2013-05-09 10:34:58 CDT
Bug report 1502 created to address konsole support for the forward slash.