Bug 143539 - KIO doesn't respect Unicode canonical equivalence of strings
Summary: KIO doesn't respect Unicode canonical equivalence of strings
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.44.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-28 09:59 UTC by Denis Jacquerye
Modified: 2018-04-13 19:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
NFC file (13 bytes, text/plain)
2018-04-13 19:34 UTC, Denis Jacquerye
Details
NFD file (14 bytes, text/plain)
2018-04-13 19:35 UTC, Denis Jacquerye
Details

Note You need to log in before you can comment on or make changes to this bug.
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!