#ifndef UTF8_H
#define UTF8_H
#include <stdint.h>
typedef struct {
uint32_t state, codep;
} utf8_decode_t;
uint32_t utf8_decode(utf8_decode_t* d, const uint32_t byte);
int utf8_encode(char* out, uint32_t c);
size_t utf8_len(const char* s, size_t n);
const char* utf8_at(const char* s, size_t n, size_t index);
size_t utf8_pos(const char* s, size_t n, size_t index);
uint32_t utf8_peek(const char* s);
uint32_t utf8_peek_at(const char* s, size_t n, size_t pos);
int utf8_icmp(const char* s1, size_t n1, const char* s2, size_t n2);
bool utf8_valid(const char* s, size_t n);
bool utf8_tolower(char* s, size_t n);
bool utf8_toupper(char* s, size_t n);
bool utf8_totitle(char* s, size_t n);
bool utf8_casefold(char* s, size_t n);
#endif