[ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.2
Ken Brown
kbrown@cornell.edu
Tue Jul 26 19:30:00 GMT 2016
On 7/26/2016 1:37 PM, Corinna Vinschen wrote:
> Now for some testing of the new API...? :)
There seems to be a collation bug. Here's a test case, extracted from
the emacs test suite:
$ cat collation_test.c
#include <wchar.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
int
main (void)
{
locale_t loc = newlocale (LC_COLLATE_MASK | LC_CTYPE_MASK,
"en_US.UTF-8", 0);
if (!loc)
{
perror ("newlocale");
exit (1);
}
wchar_t *p1 = L"xyzzy", *p2 = L"XYZZY";
errno = 0;
int res = wcscoll_l (p1, p2, loc);
if (errno)
{
perror ("wcscoll_l");
exit (1);
}
char res_ch = res < 0 ? '<' : res > 0 ? '>' : '=';
freelocale (loc);
printf ("\"%ls\" %c \"%ls\" in locale en_US.UTF-8\n", p1, res_ch, p2);
}
$ gcc collation_test.c
$ ./a
"xyzzy" > "XYZZY" in locale en_US.UTF-8
Ken
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list