1 /* Based on a test case by Paul Eggert. */
8 char const string
[] = "";
12 test (const char *locale
)
20 if (setlocale (LC_COLLATE
, locale
) == NULL
)
22 printf ("cannot set locale \"%s\"\n", locale
);
25 bufsize
= strxfrm (NULL
, string
, 0) + 1;
26 buf
= malloc (bufsize
);
29 printf ("cannot allocate %zd bytes\n", bufsize
);
32 r
= strxfrm (buf
, string
, bufsize
);
36 printf ("locale \"%s\": strxfrm returned %zu, strlen returned %zu\n",
52 result
|= test ("en_US.ISO-8859-1");
53 result
|= test ("de_DE.UTF-8");