How to display file names

Rolf Magnus ramagnus at
Tue Dec 16 22:13:20 GMT 2003

On Monday 15 December 2003 10:09, David Faure wrote:
> On Saturday 13 December 2003 13:36, André Wöbbeking wrote:
> > Hi,
> >
> > how should a file like "bla %2F foo" be displayed? As
> >
> > 1) "bla %2F foo"
> > 2) "bla %252F foo" (like in Konqueror's copy dialog)
> > 3) "bla / foo" (like in Konqueror's views)
> >
> > I think it should be 1) as it is the real name. What do you think?
> In KDE, it's 3). KDE encodes '/' in filenames as %2F.
> If you create a file in KDE which is named bla / foo you'll get a %2F on
> the filesystem.

I'd rather expect the program to look for a directory called "bla " and add a 
file named " foo" to it. And actually, that seems what e.g. the file dialog 
is doing. To open a file called "bla %2F foo", I'd need to enter exactly 
that. Unfortunately, that's not the name that is displayed in the dialog's 
list view. It says "bla / foo".

> If you create a file in KDE which is named "blah %2F foo" 
> you'll get %252F on the filesystem. This gives a slight incompatibility
> with the filesystem like you found above, but it allows users to use _any_
> character in filenames, including slash. KDE: accept no limitations :)

I don't think this is a good idea. The inconsistancies when doing this kind of 
encoding are worse than not allowing / in file names, IMHO. Consider my above 
example. If the file dialog would hide all that encoding stuff, which file 
should be opened when I enter "blah / foo"? From KDE's POV, there are now two 
files with the exact same name.
This encoding thing seems to open a can of worms that you could only close by
either removing the use of / as directory separator in _all_ of KDE, or by 
simply not allowing / in file names like everyone else.

> 2) looks like a bug, probably a missing prettyURL and/or
> KIO::decodeFileName.

Prof:  I'm sorry, Fry, but astronomers renamed Uranus in 2620
       to end that stupid joke once and for all.
Fry:   Oh.  What's it called now?
Prof:  Urectum.

More information about the kde-core-devel mailing list