Converts High- and Low-Surrogate to UTF-8 code units, stored in a std::string
| 708 | |
| 709 | // Converts High- and Low-Surrogate to UTF-8 code units, stored in a std::string |
| 710 | std::string Helper::utf16_utf8(uint16_t high, uint16_t low) { |
| 711 | if( high <= 0xD7FF || high >= 0xE000) { |
| 712 | // just a BMP code point |
| 713 | return encodeUtf8(high); |
| 714 | } |
| 715 | uint32_t cp = (high - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000; // TODO * 0x400 => >> 10 |
| 716 | return encodeUtf8(cp); |
| 717 | } |
| 718 | |
| 719 | |
| 720 |
nothing calls this directly
no outgoing calls
no test coverage detected