| 10971 | namespace { |
| 10972 | |
| 10973 | size_t trailingBytes(unsigned char c) { |
| 10974 | if ((c & 0xE0) == 0xC0) { |
| 10975 | return 2; |
| 10976 | } |
| 10977 | if ((c & 0xF0) == 0xE0) { |
| 10978 | return 3; |
| 10979 | } |
| 10980 | if ((c & 0xF8) == 0xF0) { |
| 10981 | return 4; |
| 10982 | } |
| 10983 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 10984 | } |
| 10985 | |
| 10986 | uint32_t headerValue(unsigned char c) { |
| 10987 | if ((c & 0xE0) == 0xC0) { |