functional: add mntent test
[libc-test.git] / src / common / utf8.c
bloba184991aa12451dfb0d771907d864e0351232696
1 #include <locale.h>
2 #include <string.h>
3 #include <langinfo.h>
4 #include "test.h"
6 int t_setutf8()
8 (void)(
9 setlocale(LC_CTYPE, "C.UTF-8") ||
10 setlocale(LC_CTYPE, "POSIX.UTF-8") ||
11 setlocale(LC_CTYPE, "en_US.UTF-8") ||
12 setlocale(LC_CTYPE, "en_GB.UTF-8") ||
13 setlocale(LC_CTYPE, "en.UTF-8") ||
14 setlocale(LC_CTYPE, "UTF-8") ||
15 setlocale(LC_CTYPE, "") );
17 if (strcmp(nl_langinfo(CODESET), "UTF-8"))
18 return t_error("cannot set UTF-8 locale for test (codeset=%s)\n", nl_langinfo(CODESET));
20 return 0;