Better solution for allowing slash in filenames

David Faure faure at kde.org
Fri Jan 18 16:44:14 GMT 2008


KDE 3.x and KDE 4.0 allow slashes in filenames by encoding them as %2F (and % as %%),
a nice trick by Torben in KDE-1, but which leads to unexpected behavior (like "foo%" and "foo%%"
both showing up as "foo%" in konqueror, the real path and the visible filename being different, etc).

I found a much better solution to allow '/' without all this escaping: using a unicode character
that looks like a slash but that isn't '/': QChar(0x2044), also known as "FRACTION SLASH".
Looks quite nice IMHO: http://web.davidfaure.fr/kde/slash.jpg

Ah... of course there's one downside: if you name a file "http://www.kde.org" you can't
copy paste that name into the webbrowser as a URL, since the slashes are not real slashes anymore.
Oh well, corner case of the corner case...

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slash.diff
Type: text/x-diff
Size: 5948 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080118/40745626/attachment.diff>


More information about the kfm-devel mailing list