1 2 3 4
#include <stdint.h> #define UTF8_ACCEPT 0 #define UTF8_REJECT 1 uint32_t utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte);