GNOME Bugzilla – Bug 631504
Sorting has issues with accents
Last modified: 2010-10-06 21:04:36 UTC
I just noticed that for gnumeric, 'î' comes after 'r' in alphabetical order... which is very wrong!
In french locale this only occurs for case insensitive sorting. In "C" locale, it always occur.
Snark: what is your locale? Please show the output of the "locale" command.
The issue is in go_string_cmp_ignorecase. It should call g_utf8_collate instead of strcmp. Of course, we should call g_utf8_collate_key at some point.
Created attachment 171826 [details] [review] Proposed patch. Do we really need to store the string case insensitive version? If yes, the patch is not what we want.
$ locale LANG=fr_FR.UTF-8 LC_CTYPE="fr_FR.UTF-8" LC_NUMERIC="fr_FR.UTF-8" LC_TIME="fr_FR.UTF-8" LC_COLLATE="fr_FR.UTF-8" LC_MONETARY="fr_FR.UTF-8" LC_MESSAGES="fr_FR.UTF-8" LC_PAPER="fr_FR.UTF-8" LC_NAME="fr_FR.UTF-8" LC_ADDRESS="fr_FR.UTF-8" LC_TELEPHONE="fr_FR.UTF-8" LC_MEASUREMENT="fr_FR.UTF-8" LC_IDENTIFICATION="fr_FR.UTF-8" LC_ALL=
Created attachment 171843 [details] [review] Enhanced patch.
Review of attachment 171843 [details] [review]: Close. GO_STRING_HAS_CASEFOLDED_COLLATE is the same as GO_STRING_HAS_CASEFOLD. I don't think that will work. Then go_string_get_casefold is going to have clear GO_STRING_HAS_CASEFOLDED_COLLATE being it will overwrite the string.
This code is getting a tad complicated.
Created attachment 171845 [details] [review] fixed patch
Created attachment 171848 [details] [review] new revised patch
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.