general kio slave for reading embedded files

Thiago Macieira thiago at kde.org
Mon Dec 18 01:24:48 GMT 2006


Clarence Dang wrote:
>On Monday 18 December 2006 09:45, Thiago Macieira wrote:
>> Clarence Dang wrote:
>> >On Sunday 17 December 2006 19:21, Thiago Macieira wrote:
>> >> 	file:///home/kde/a.zip#/b.tar.gz/x.rpm/y.deb/README
>> >> or
>> >> 	file:///home/kde/a.zip#/b.tar.gz#/x.rpm#/y.deb#/README
>> >
>> >Side note about #: it's an allowed character in a filename (since
>> > it's != '\0' && != '/').  I know it's always been done this way but
>> > just the other day, I had problems dragging a file with a # into
>> > ark.  I still think it can be done with /.
>>
>> It's not a problem here because that's a URL. Any # in the filename
>> will be escaped to %23.
>
>Good point - that's solves the problem.  Although now I'm confused: if
> my filename has a #, in which KDE dialogs should I type # and in which
> should I type %23?  I'll also look into the ark bug.

If you're typing a file path, it's #

If you're typing a URL, it's %23.

The kfile dialogs allow you to type both. But a file path and a URL can be 
easily told apart.

The same goes for spaces vs %20, question marks vs %3f and the percent 
sign itself against %25. To make matters worse, there's also the issue of 
the encoding of non-ASCII letters. So, unless you really have to, you 
want to type file paths, not URLs.

If this breaks anywhere, there are wrong assumptions being made. The most 
common cause in KDE 3 is by far the use of the KURL constructor instead 
of KURL::fromPathOrUrl. We have fortunately fixed that for KDE 4 (the 
constructor does the expected thing). The next cause is probably the 
concatenation of file paths with "file://" to construct a URL (I argued 
this in kde-commits this week).

That means bug.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061218/4e4b0b3e/attachment.sig>


More information about the kde-core-devel mailing list