| 2057 | } |
| 2058 | |
| 2059 | uint32_t headerValue(unsigned char c) { |
| 2060 | if ((c & 0xE0) == 0xC0) { |
| 2061 | return c & 0x1F; |
| 2062 | } |
| 2063 | if ((c & 0xF0) == 0xE0) { |
| 2064 | return c & 0x0F; |
| 2065 | } |
| 2066 | if ((c & 0xF8) == 0xF0) { |
| 2067 | return c & 0x07; |
| 2068 | } |
| 2069 | DOCTEST_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 2070 | } |
| 2071 | |
| 2072 | void hexEscapeChar(std::ostream& os, unsigned char c) { |
| 2073 | std::ios_base::fmtflags f(os.flags()); |