GNOME Bugzilla – Bug 314255
g_utf8_collate_key() doesn't work right in some cases
Last modified: 2005-11-30 05:06:30 UTC
Distribution/Version: Debian Sarge g_utf8_collate_key() produces same result for two different strings when LANG is set to en_US on Debian. It reproduces in glib-2.6 and glib from CVS on Debian Sarge i386, and in glib 2.8.0-1 on Debian Sid on ppc. It does not reproduce on FreeBSD 7-CURRENT. Don't know about other systems. Attached is the test case - it gets (and prints) collation keys for two russian strings: one is two small 'p' letters, another one is two small 'd' letters. The program checks that strings are valid utf8. The output here (and on ppc debian) is the following: ------------------------------------------------------------------ muntyan@localhost:~/projects/gtk/cvs/stuff$ ./a.out <1><1><1><1><98><1><98> ** ERROR **: file bug.c: line 20 (main): assertion failed: (strcmp (coll1, coll2)) aborting... Aborted ------------------------------------------------------------------ However, it works fine with LANG set to en_US.UTF8: muntyan@localhost:~/projects/gtk/cvs/stuff$ LANG=en_US.UTF8 ./a.out <-48><-76><-48><-76> muntyan@localhost:~/projects/gtk/cvs/stuff$
Created attachment 51182 [details] The test case
That has to be a bug of wcsxfrm() on that platform.