#include #include #define UTF_OK 0 #define UTF_ERR -1 typedef uint8_t utf8_t; typedef uint8_t utf16_t; /* unicode code point*/ typedef uint32_t ucp_t; int utf8_enc(ucp_t ch, utf8_t *str); int utf8_dec(utf8_t *str, ucp_t *ch); int utf8_len_ch(ucp_t ch); int utf8_len_str(utf8_t *str); int utf8_seek(utf8_t *str, int off, ucp_t *ch); int utf8_verify(utf8_t *str, size_t str_size, size_t *str_len); int utf16_enc(ucp_t ch, utf16_t *str); int utf16_dec(utf16_t *str, ucp_t *ch); int utf16_len_ch(ucp_t ch); int utf16_len_str(utf16_t *str); int utf16_seek(utf16_t *str, int off, ucp_t *ch);