13#include <tds_sysdep_public.h> 
   18extern const uint8_t utf8_table[];
 
   21decode_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];