| 12759 | namespace { |
| 12760 | |
| 12761 | size_t trailingBytes(unsigned char c) { |
| 12762 | if ((c & 0xE0) == 0xC0) { |
| 12763 | return 2; |
| 12764 | } |
| 12765 | if ((c & 0xF0) == 0xE0) { |
| 12766 | return 3; |
| 12767 | } |
| 12768 | if ((c & 0xF8) == 0xF0) { |
| 12769 | return 4; |
| 12770 | } |
| 12771 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 12772 | } |
| 12773 | |
| 12774 | uint32_t headerValue(unsigned char c) { |
| 12775 | if ((c & 0xE0) == 0xC0) { |