|
Szabolcs Nagy |
defcb8 |
#include <locale.h>
|
|
Szabolcs Nagy |
defcb8 |
#include <string.h>
|
|
Szabolcs Nagy |
defcb8 |
#include <langinfo.h>
|
|
Szabolcs Nagy |
defcb8 |
#include "test.h"
|
|
Szabolcs Nagy |
defcb8 |
|
|
Szabolcs Nagy |
defcb8 |
int t_setutf8()
|
|
Szabolcs Nagy |
defcb8 |
{
|
|
Szabolcs Nagy |
defcb8 |
(void)(
|
|
Szabolcs Nagy |
defcb8 |
setlocale(LC_CTYPE, "C.UTF-8") ||
|
|
Szabolcs Nagy |
defcb8 |
setlocale(LC_CTYPE, "POSIX.UTF-8") ||
|
|
Szabolcs Nagy |
defcb8 |
setlocale(LC_CTYPE, "en_US.UTF-8") ||
|
|
Szabolcs Nagy |
defcb8 |
setlocale(LC_CTYPE, "en_GB.UTF-8") ||
|
|
Szabolcs Nagy |
defcb8 |
setlocale(LC_CTYPE, "en.UTF-8") ||
|
|
Szabolcs Nagy |
defcb8 |
setlocale(LC_CTYPE, "UTF-8") ||
|
|
Szabolcs Nagy |
defcb8 |
setlocale(LC_CTYPE, "") );
|
|
Szabolcs Nagy |
defcb8 |
|
|
Szabolcs Nagy |
defcb8 |
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
|
|
Szabolcs Nagy |
defcb8 |
return t_error("cannot set UTF-8 locale for test (codeset=%s)\n", nl_langinfo(CODESET));
|
|
Szabolcs Nagy |
defcb8 |
|
|
Szabolcs Nagy |
defcb8 |
return 0;
|
|
Szabolcs Nagy |
defcb8 |
}
|