After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 352237 - g_utf8_collate_key_for_filename breaks case ordering
g_utf8_collate_key_for_filename breaks case ordering
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: i18n
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 745664 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-21 09:53 UTC by Alexander Larsson
Modified: 2018-05-24 10:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexander Larsson 2006-08-21 09:53:05 UTC
For some reason g_utf8_collate_key_for_filename sorts case-different files different. As a test case, use: "Test1.txt", "test2.txt", "test3.txt". g_utf8_collate_key will show them in that order. However, g_utf8_collate_key_for_filename will order them as "test2.txt", "test3.txt", "Test1.txt".
Comment 1 Matthias Clasen 2007-03-16 03:40:00 UTC
This is a reflection of the fact that the collation rules are typically not "compositional". It (conceptionally) uses several passes and only considers 
case differences in a later pass.

Sorting complete strings yields

test1
Test1
test2
Test2

but if you split the numbers off and compare the strings and numbers 
separately, you get

test1
test2
Test1
Test2 

because test < Test 

The only fix here would be to interleave our special handling of numbers 
and .s with the usual multipass collation algorithm, which is something
I'm not really prepared to do...
Comment 2 António Fernandes 2017-08-13 16:42:18 UTC
*** Bug 745664 has been marked as a duplicate of this bug. ***
Comment 3 GNOME Infrastructure Team 2018-05-24 10:51:37 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/62.