Bug 143539

Summary: KIO doesn't respect Unicode canonical equivalence of strings
Product: [Frameworks and Libraries] frameworks-kio Reporter: Denis Jacquerye <moyogo>
Component: generalAssignee: David Faure <faure>
Status: CONFIRMED ---    
Severity: normal CC: faure, kdelibs-bugs, nate
Priority: NOR    
Version: 5.44.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: NFC file
NFD file

Description Denis Jacquerye 2007-03-28 09:59:58 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Kfile currently breaks Unicode.

See Bug 143530 for details.

In short Kfile doesn't consider equivalent what Unicode defines as canonically equivalent.
For example if a file "é" exist, opening "é" doesn't open the existing file (as long as "é" doesn't exists). Yet "é" and "é" are the 'same' string for Unicode.

Kfile needs to:
- normalize strings before comparing filenames when checking for conflict when saving a file
- normalize strings before autocomplete
- normalize strings to match existing filename with queried filename.

It would probably be best to use NFC when creating files, see http://www.w3.org/TR/charmod-norm/#sec-NormalizationMotivation for motivation.
Comment 1 Christoph Feck 2009-08-27 02:37:31 UTC
Moving from "kio/kfile" component to "kfile" product, helps sorting out duplicates.
Comment 2 David Faure 2010-10-29 12:58:34 UTC
Looks like this requires using QString::normalized() in the right places and with the right parameters, but the issue is too complex for me. Anyway I'd rather wait until http://bugreports.qt.nokia.com/browse/QTBUG-912 is fixed so that we can just do the same in KDE.
Comment 3 Nate Graham 2018-04-13 15:34:05 UTC
Is this still an issue with KDE Frameworks 5.44 or greater?
Comment 4 Denis Jacquerye 2018-04-13 19:34:22 UTC
Created attachment 112012 [details]
NFC file

File with NFC string "école.txt"
Comment 5 Denis Jacquerye 2018-04-13 19:35:00 UTC
Created attachment 112013 [details]
NFD file

File with NFD string "école.txt"
Comment 6 Denis Jacquerye 2018-04-13 19:35:46 UTC
Yes, it can still create the two files I’ve attached in 5.44.
Comment 7 Denis Jacquerye 2018-04-13 19:36:29 UTC
Each file was created with name as in its content.
Comment 8 Nate Graham 2018-04-13 19:37:58 UTC
Thanks for confirming!