This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug locale/18927] Different strings should never collate as equal
- From: "krizan at eset dot sk" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 13 Jan 2017 14:46:59 +0000
- Subject: [Bug locale/18927] Different strings should never collate as equal
- Auto-submitted: auto-generated
- References: <bug-18927-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18927
Matej Krizan <krizan at eset dot sk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |krizan at eset dot sk
--- Comment #12 from Matej Krizan <krizan at eset dot sk> ---
Hello,
let me resurrect this bugreport and stress the grave severity of it by another
example:
#include <string.h>
#include <stdio.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "en_US.UTF-8");
const char s1[] = "\343\202\244", s2[] = "\343\203\211";
printf("%s\n%s\nstrcoll: %i\nstrcmp: %i\n",
s1, s2, strcoll(s1, s2), strcmp(s1, s2));
return 0;
}
which outputs (using glibc 2.24 on Fedora25):
イ
ド
strcoll: 0
strcmp: -1
meaning that *strcoll is unusable in any sane program*, because it can say that
different characters are equal in the (probably) most common en_US.UTF-8
locale.
--
You are receiving this mail because:
You are on the CC list for the bug.