| 10889 | namespace { |
| 10890 | |
| 10891 | size_t trailingBytes(unsigned char c) { |
| 10892 | if ((c & 0xE0) == 0xC0) { |
| 10893 | return 2; |
| 10894 | } |
| 10895 | if ((c & 0xF0) == 0xE0) { |
| 10896 | return 3; |
| 10897 | } |
| 10898 | if ((c & 0xF8) == 0xF0) { |
| 10899 | return 4; |
| 10900 | } |
| 10901 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 10902 | } |
| 10903 | |
| 10904 | uint32_t headerValue(unsigned char c) { |
| 10905 | if ((c & 0xE0) == 0xC0) { |