Bug 159241 - dolphin can't handle files with its filename not correctly encoded with current locale
Summary: dolphin can't handle files with its filename not correctly encoded with curre...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 160072 168219 261021 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-13 14:01 UTC by David
Modified: 2013-07-01 13:17 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0


Attachments
program to create filename with all bytes permitted by Linux VFS (519 bytes, text/plain)
2010-02-20 23:03 UTC, Andreas Nordal
Details
Files with broken names. (621 bytes, application/x-compressed-tar)
2012-01-12 20:02 UTC, Eike Welk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David 2008-03-13 14:01:54 UTC
Version:           svn (using Devel)
Installed from:    Compiled sources
OS:                Linux

I have UTF8 in my system, but almost every other external files I usually get, have their filenames encoded in ISO-8859-15. The result is that I cannot use them in my box (which is OK, I just need to rename invalid characters, as I did in KDE 3.5.*). But, dolphin can't handle them, nor deleting, nor renaming, nor anything. I am not sure if it is a bug in the KIO_File or dolphin itself, but it annoys a bit, as it forces me to rename things though a konsole.

Way to reproduce:
1.- Have a system in with a locale of UTF8
2.- Try to use a file with a NON UTF8 filename with special characters (for example áéíóú) in it.
3.- You will see that you can't do anything with it inside dolphin.

(While I was testing, I realized that either konqueror can handle them, so it is definitely a KIO_File bug, but I don't know who to CC, so please do it for me :) )
Comment 1 Dario Andres 2008-08-26 00:09:24 UTC
This is related/duplicate of bug 165400 / bug 165044
Comment 2 Julien Bigot 2008-10-09 14:29:08 UTC
Same here with KDE 4.1.2 from debian experimental.
This is a quite annoying one !
It also seems quite a lot of people encounter this, the status could be changed from UNCONFIRMED to something else.
Comment 3 FiNeX 2008-12-20 12:34:20 UTC
I confirm this bug. The bug #165044, which is the same as this, has been closed as WONTFIX. I've asked to reopen it. When it will be reopened/solved. This bug shouls be marked as dup.
Comment 4 FiNeX 2008-12-20 12:37:26 UTC
*** Bug 160072 has been marked as a duplicate of this bug. ***
Comment 5 Andreas Nordal 2010-02-20 23:03:41 UTC
Created attachment 40970 [details]
program to create filename with all bytes permitted by Linux VFS
Comment 6 Andreas Nordal 2010-02-20 23:27:11 UTC
Forget encoding. Konqueror and Dolphin should take the bytes in a filename literally!

I just submitted a test program that creates a file with a name containing all 254 bytes permitted by Linux VFS. This bug is not solved before Konq and Dolphin can open, rename and delete such files.

By the way, I stumbled upon this bug today using Konqueror 4.4.0 and also confirmed it in Dolphin 1.4. What I did was to unzip a .zip archive from a friend using Windows - yet another source of non-UTF-8 filenames.
Comment 7 Vesselin Dimitrov 2010-05-03 17:51:34 UTC
*** This bug has been confirmed by popular vote. ***
Comment 8 Jason 2010-07-12 07:45:05 UTC
Not just dolphin, and I understand it's a limitation of qfile/qt... but see, I don't care when I see everybody else working with broken encodings just fine.  Rox-filer does a decent job even...  I'm sorry to say this is plain unacceptable.
Comment 9 Andreas Nordal 2010-08-08 00:00:00 UTC
Limitation of qfile/qt?
Never ever store a filename in a QString for later use! Doing that involves text codecs. Use QByteArray if you are so extremely keen.
Comment 10 David 2011-05-30 22:07:02 UTC
I think this bug is ancient enough to be fixed: QT has evolved a lot (in case it is QFile related), and is present since KDE 3.5!!!
I know it is not a life or death bug, but it is very very annoying...
Any posibilities it can be fixed soon enough?
Comment 11 Eitzenberger Thomas 2011-10-10 10:21:18 UTC
This stoneage bug REALLY should get fixed asap or at least a workaround besides going to the shell and do deletes/renames manually....
Comment 12 Ute Hauth 2011-11-26 12:52:21 UTC
subscribe
Comment 13 Eike Welk 2012-01-12 19:57:41 UTC
It would be great if some solution would be implemented. I have just discovered some files with broken file names on my computer. 

When these files are in the trash, the trashcan can no longer be emptied.
Comment 14 Eike Welk 2012-01-12 20:02:05 UTC
Created attachment 67752 [details]
Files with broken names.

An archive that contains files with broken names. They were created years ago by "kpdf". The folder that contained these files prevented that the trash could be completely emptied.
Comment 15 phobeus 2012-06-23 12:50:10 UTC
Any news on this issue? It is actually one of the most painful issues having since switched to KDE 4 and especially native speakers might not be fully aware of this issue. Especially unexperience users will be completely caught up with some files they are not able to remove from the system anymore or making the trash bin broken.

Eike actually provided some very good examples that allows to reproduce this issue very easily. I am not sure, why this issue seems to be that complicate it cannot be fixed. Maybe one developer with more insight in KDE might point out, where exactly the problem is originated? Confirm being present still with KDE 4.8.3
Comment 16 Dawit Alemayehu 2013-06-15 20:31:05 UTC
*** Bug 168219 has been marked as a duplicate of this bug. ***
Comment 17 Dawit Alemayehu 2013-06-18 06:16:05 UTC
*** Bug 261021 has been marked as a duplicate of this bug. ***
Comment 18 Szokovacs Robert 2013-07-01 10:55:03 UTC
Git commit f4269ef3498581964e8a1a13cd0d6d7f19c88762 by Szókovács Róbert.
Committed on 01/07/2013 at 10:28.
Pushed by szokovacs into branch 'master'.

Fix/workaround for legacy encoded filename handling

This patch works around the problem of filenames that are not valid
UTF8 strings: in KLocalePrivate::initFileNameEncoding() KDE sets the
QFile's encoding/decoding function, to to/fromUTF8() in QString, which
in turn calls QUtf8's converter function. I replaced this with the said
functions' copy/pasted version and changed it, so when it encounters an
invalid UTF8 string, it will encode it byte by byte, mapping the lower
128 their normal unicode place and the upper 128 to U+10FE00-U+10FE7F,
and the decoder reverses it.
REVIEW: 110043

M  +180  -2    kdecore/localization/klocale_kde.cpp

http://commits.kde.org/kdelibs/f4269ef3498581964e8a1a13cd0d6d7f19c88762