change a_float to a_real
[liba.git] / test / utf.h
blobf65520ce9c58fead6bf32b483277d1e1419139b6
1 #define MAIN(x) utf##x
2 #include "test.h"
3 #include "a/utf.h"
5 int main(int argc, char *argv[]) /* NOLINT(misc-definitions-in-headers) */
7 int i;
8 for (i = 1; i < argc; ++i)
10 char buf[7];
11 char const *s;
12 a_u32 val = 0;
13 unsigned int offset = 0;
14 debug("%s %u", argv[i], a_cast_s(unsigned int, a_utf_length(argv[i])));
15 for (s = argv[i]; (void)(offset = a_utf_decode(s, &val)), offset; s += offset)
17 a_utf_encode(A_NULL, val);
18 buf[a_utf_encode(buf, val)] = 0;
19 debug(" %s:%" A_PRI32 "u", buf, val);
20 if (!*s) { break; }
22 debug("\n");
24 return 0;