| 15431 | namespace { |
| 15432 | |
| 15433 | size_t trailingBytes(unsigned char c) { |
| 15434 | if ((c & 0xE0) == 0xC0) { |
| 15435 | return 2; |
| 15436 | } |
| 15437 | if ((c & 0xF0) == 0xE0) { |
| 15438 | return 3; |
| 15439 | } |
| 15440 | if ((c & 0xF8) == 0xF0) { |
| 15441 | return 4; |
| 15442 | } |
| 15443 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 15444 | } |
| 15445 | |
| 15446 | uint32_t headerValue(unsigned char c) { |
| 15447 | if ((c & 0xE0) == 0xC0) { |