1 #ifndef INCLUDED_U5E_UTF8_UTIL 2 #define INCLUDED_U5E_UTF8_UTIL 18 if (octet & 0b10000000) {
29 if ((octet & 0b11000000) == 0b10000000) {
40 if ((octet & 0b11000000) == 0b11000000) {
54 return std::max(__builtin_clz(~(first_octet << 24)),1);
61 return std::ceil((
float)(32 - __builtin_clz(value) - 1) / (
float)6);
static bool is_codepoint_start(const char octet)
static int encoded_size(int value)
static bool is_7bit_character(const char octet)
static bool is_codepoint_continuation(const char octet)
static int codepoint_size(const char first_octet)
Basic operations necessary for implementing utf8.