| 413 | } |
| 414 | |
| 415 | static char32_t utf8_decode(const std::string & str, std::string::size_type & i) { |
| 416 | offset_pt res = utf8_decode_check(str, i); |
| 417 | if (res.offset < 0) { |
| 418 | i += 1; |
| 419 | return 0xFFFD; |
| 420 | } else { |
| 421 | i += res.offset; |
| 422 | return res.pt; |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | static void utf16_encode(char32_t pt, std::u16string & out) { |
| 427 | if (pt < 0x10000) { |
no test coverage detected