| 49 | } |
| 50 | |
| 51 | static inline char32_t utf16Decode(const char16_t* str, std::u16string::size_type& i) { |
| 52 | OffsetPt res = utf16DecodeCheck(str, i); |
| 53 | if (res.offset < 0) { |
| 54 | i += 1; |
| 55 | return 0xFFFD; |
| 56 | } else { |
| 57 | i += res.offset; |
| 58 | return res.pt; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | static inline void utf8Encode(char32_t pt, std::vector<char>& out) { |
| 63 | if (pt < 0x80) { |
no test coverage detected