| 8335 | namespace { |
| 8336 | |
| 8337 | size_t trailingBytes(unsigned char c) { |
| 8338 | if ((c & 0xE0) == 0xC0) { |
| 8339 | return 2; |
| 8340 | } |
| 8341 | if ((c & 0xF0) == 0xE0) { |
| 8342 | return 3; |
| 8343 | } |
| 8344 | if ((c & 0xF8) == 0xF0) { |
| 8345 | return 4; |
| 8346 | } |
| 8347 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 8348 | } |
| 8349 | |
| 8350 | uint32_t headerValue(unsigned char c) { |
| 8351 | if ((c & 0xE0) == 0xC0) { |