| 15125 | namespace { |
| 15126 | |
| 15127 | size_t trailingBytes(unsigned char c) { |
| 15128 | if ((c & 0xE0) == 0xC0) { |
| 15129 | return 2; |
| 15130 | } |
| 15131 | if ((c & 0xF0) == 0xE0) { |
| 15132 | return 3; |
| 15133 | } |
| 15134 | if ((c & 0xF8) == 0xF0) { |
| 15135 | return 4; |
| 15136 | } |
| 15137 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 15138 | } |
| 15139 | |
| 15140 | uint32_t headerValue(unsigned char c) { |
| 15141 | if ((c & 0xE0) == 0xC0) { |