13 #include <tds_sysdep_public.h> 16 #define UTF8_REJECT 12 18 extern const uint8_t utf8_table[];
20 static inline uint32_t
21 decode_utf8(uint32_t* state, uint32_t* codep, uint32_t byte)
23 uint32_t type = utf8_table[byte];
25 *codep = (*state != UTF8_ACCEPT) ?
26 (byte & 0x3fu) | (*codep << 6) :
27 (0xff >> type) & (byte);
29 *state = utf8_table[256 + *state + type];