| 14678 | namespace { |
| 14679 | |
| 14680 | size_t trailingBytes(unsigned char c) { |
| 14681 | if ((c & 0xE0) == 0xC0) { |
| 14682 | return 2; |
| 14683 | } |
| 14684 | if ((c & 0xF0) == 0xE0) { |
| 14685 | return 3; |
| 14686 | } |
| 14687 | if ((c & 0xF8) == 0xF0) { |
| 14688 | return 4; |
| 14689 | } |
| 14690 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 14691 | } |
| 14692 | |
| 14693 | uint32_t headerValue(unsigned char c) { |
| 14694 | if ((c & 0xE0) == 0xC0) { |