| 15107 | namespace { |
| 15108 | |
| 15109 | size_t trailingBytes(unsigned char c) { |
| 15110 | if ((c & 0xE0) == 0xC0) { |
| 15111 | return 2; |
| 15112 | } |
| 15113 | if ((c & 0xF0) == 0xE0) { |
| 15114 | return 3; |
| 15115 | } |
| 15116 | if ((c & 0xF8) == 0xF0) { |
| 15117 | return 4; |
| 15118 | } |
| 15119 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 15120 | } |
| 15121 | |
| 15122 | uint32_t headerValue(unsigned char c) { |
| 15123 | if ((c & 0xE0) == 0xC0) { |