| 10902 | } |
| 10903 | |
| 10904 | uint32_t headerValue(unsigned char c) { |
| 10905 | if ((c & 0xE0) == 0xC0) { |
| 10906 | return c & 0x1F; |
| 10907 | } |
| 10908 | if ((c & 0xF0) == 0xE0) { |
| 10909 | return c & 0x0F; |
| 10910 | } |
| 10911 | if ((c & 0xF8) == 0xF0) { |
| 10912 | return c & 0x07; |
| 10913 | } |
| 10914 | CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); |
| 10915 | } |
| 10916 | |
| 10917 | void hexEscapeChar(std::ostream &os, unsigned char c) { |
| 10918 | os << "\\x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(c); |