1 #include <ccan/utf8/utf8.h>
2 /* Include the C files directly. */
3 #include <ccan/utf8/utf8.c>
4 #include <ccan/tap/tap.h>
7 static bool utf8_check(const char *src, size_t len)
10 struct utf8_state utf8_state = UTF8_STATE_INIT;
13 for (i = 0; i < len; i++) {
14 decoded = utf8_decode(&utf8_state, src[i]);
25 int main(int argc, char **argv)
28 char dest[UTF8_MAX_LEN];
30 plan_tests(0x10FFFF - (0xDFFF - 0xD7FF + 2));
32 for (i = 1; i < 0x10FFFF; i++) {
34 if (i >= 0xD7FF && i <= 0xDFFF)
36 len = utf8_encode(i, dest);
38 ok1(utf8_check(dest, len));