| 162 | } |
| 163 | |
| 164 | FORCE_INLINE |
| 165 | bool validate_utf8_following_bytes(const char* data, int32_t data_len, |
| 166 | int32_t char_index) { |
| 167 | for (int j = 1; j < data_len; ++j) { |
| 168 | if ((data[char_index + j] & 0xC0) != 0x80) { // bytes following head-byte of glyph |
| 169 | return false; |
| 170 | } |
| 171 | } |
| 172 | return true; |
| 173 | } |
| 174 | |
| 175 | // Count the number of utf8 characters |
| 176 | // return 0 for invalid/incomplete input byte sequences |
no outgoing calls
no test coverage detected