Bug 51306 - '%'-characters get doubled and hidden [patch]
Summary: '%'-characters get doubled and hidden [patch]
Status: RESOLVED LATER
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 3.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 70020 100516 142195 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-28 23:26 UTC by Florian Brunner
Modified: 2008-05-04 18:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Brunner 2002-11-28 23:26:02 UTC
Version:            (using KDE KDE 3.0.4)
Installed from:    SuSE RPMs

1) on shell: touch 'test%%test.txt' -> 'ls' shows 'test%%test.txt', Konqueror shows 'test%test.txt' (single '%'-character)
2) in Konqueror: right-click -> new -> textfile -> 'test%test.txt' => Konqueror shows 'test%test.txt' but actually created 'test%%test.txt' (as shwon by the 'ls' command).

Note that it's possible that Konqueror shows 2 'test%test.txt': One for 'test%%test.txt' and one for 'test%test.txt' (which has been created outside of Konqueror)
Comment 1 David Faure 2002-12-02 01:19:34 UTC
Subject: Re:  New: '%'-characters get doubled and hidden

On Thursday 28 November 2002 23:26, Florian Brunner wrote:
> 1) on shell: touch 'test%%test.txt' -> 'ls' shows 'test%%test.txt', Konqueror shows 'test%test.txt' (single '%'-character)
Right.
Now try creating a file, in Konqueror, with a '/' in the name -> it will work,
but the actual file will use %2f on disk.
This "encoding" done at the Konqueror level allows this (and any other kind
of future extensions) - meaning that _any_ character can be used in a filename,
in KDE. (People running KDE on Windows might want to add something to
handle ':' in KIO::encodeFileName/decodeFileName, for instance. ':' is no problem
on Linux but is "forbidden" on Windows).

It is of course an unwanted side effect of this, that a real file named a%%b will appear
as a%b ....

Historical note: back when each bookmark was a separate .desktop file, it
was necessary to be able to use a '/' in a filename, this is when this encoding/decoding
layer was added.

> Note that it's possible that Konqueror shows 2 'test%test.txt': 
> One for 'test%%test.txt' and one for 'test%test.txt' (which has been created outside of Konqueror)
Ouch, indeed. Never thought about that....

I see no way to "fix" this, however.

Of course none of those problems happen to "end users" which only use KDE
to create files....

Comment 2 Stephan Kulow 2003-12-11 15:19:58 UTC
*** Bug 70020 has been marked as a duplicate of this bug. ***
Comment 3 Philippe Rigault 2004-01-21 07:11:14 UTC
I believe there is a solution.
Please see my comment (#11) for a related problem
http://bugs.kde.org/show_bug.cgi?id=53751

There I suggest to visually represent the fact that a string is URL-encoded, and to add a mechanism to toggle between encoded/decoded.
Comment 4 lexual 2005-07-03 13:22:16 UTC
confirming still an issue for 3.4.1
Comment 5 Dirk Stoecker 2006-08-22 14:02:23 UTC
*** Bug 100516 has been marked as a duplicate of this bug. ***
Comment 6 Marc Schiffbauer 2006-10-11 00:21:49 UTC
This bug is still there in 3.5.4 :-/

I vote for completely removing this filename "borking" as "/" is *not* an allowed character in filenames. And IMO i could be very confusing too:

Imagine having a file named foo%2fbar.txt and a directory foo/ with a file in it called bar.txt ... If I type foo/bar.txt in some file open, save as dialog or even on konquis URL-bar ... which file will it choose to show me?


cheers
-Marc
Comment 7 Bram Schoenmakers 2007-02-25 23:11:07 UTC
*** Bug 142195 has been marked as a duplicate of this bug. ***
Comment 8 Marc Schiffbauer 2008-01-15 02:36:27 UTC
Sad to say this annoying bug is still present in KDE.  4.0.0. :-(
Comment 9 Maksim Orlovich 2008-01-19 07:16:53 UTC
There was just discussion going on about it, actually.
Comment 10 Marc Schiffbauer 2008-01-19 14:51:16 UTC
After talking to David on irc he submitted a patch a little later. I guess that it will fix it.

Filenames will not be encoded anymore. Slashes in filenames are still allowed but will we converted to a utf8 char named "Fraction slash" (QChar(0x2044))

See:
http://lists.kde.org/?l=kfm-devel&m=120067470101987&w=2
Comment 11 George Goldberg 2008-05-04 08:18:44 UTC
Bug still present in 3.5.9, but fixed in svn trunk r803492.
Comment 12 A. Spehr 2008-05-04 18:54:55 UTC
It looks like this is fixed in 4, so I'm closing.