1: #include <locale.h>
2: #include <time.h>
3: #include <stdio.h>
4:
5: static int
6: do_test (void)
7: {
8: if (setlocale (LC_ALL, "vi_VN.TCVN5712-1") == NULL)
9: {
10: puts ("cannot set locale");
11: return 1;
12: }
13: struct tm tm;
14:
15: static const char s[] = "\
16: \x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74";
17: char *r = strptime (s, "%b", &tm);
18: printf ("r = %p, r-s = %tu, tm.tm_mon = %d\n", r, r - s, tm.tm_mon);
19: return r == NULL || r - s != 14 || tm.tm_mon != 10;
20: }
21:
22: #define TEST_FUNCTION do_test ()
23: #include "../test-skeleton.c"