| 12487 | namespace { |
| 12488 | |
| 12489 | size_t trailingBytes(unsigned char c) { |
| 12490 | if ((c & 0xE0) == 0xC0) { |
| 12491 | return 2; |
| 12492 | } |
| 12493 | if ((c & 0xF0) == 0xE0) { |
| 12494 | return 3; |
| 12495 | } |
| 12496 | if ((c & 0xF8) == 0xF0) { |
| 12497 | return 4; |
| 12498 | } |
| 12499 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 12500 | } |
| 12501 | |
| 12502 | uint32_t headerValue(unsigned char c) { |
| 12503 | if ((c & 0xE0) == 0xC0) { |