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 314255 - g_utf8_collate_key() doesn't work right in some cases
g_utf8_collate_key() doesn't work right in some cases
Status: RESOLVED NOTGNOME
Product: glib
Classification: Platform
Component: general
2.8.x
Other Linux
: Normal critical
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2005-08-23 11:42 UTC by Yevgen Muntyan
Modified: 2005-11-30 05:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The test case (447 bytes, text/plain)
2005-08-23 11:44 UTC, Yevgen Muntyan
Details

Description Yevgen Muntyan 2005-08-23 11:42: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$
Comment 1 Yevgen Muntyan 2005-08-23 11:44:25 UTC
Created attachment 51182 [details]
The test case
Comment 2 Matthias Clasen 2005-11-30 05:06:30 UTC
That has to be a bug of wcsxfrm() on that platform.