| 2044 | namespace { |
| 2045 | |
| 2046 | size_t trailingBytes(unsigned char c) { |
| 2047 | if ((c & 0xE0) == 0xC0) { |
| 2048 | return 2; |
| 2049 | } |
| 2050 | if ((c & 0xF0) == 0xE0) { |
| 2051 | return 3; |
| 2052 | } |
| 2053 | if ((c & 0xF8) == 0xF0) { |
| 2054 | return 4; |
| 2055 | } |
| 2056 | DOCTEST_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 2057 | } |
| 2058 | |
| 2059 | uint32_t headerValue(unsigned char c) { |
| 2060 | if ((c & 0xE0) == 0xC0) { |