| 138 | } |
| 139 | |
| 140 | static inline char32_t utf8Decode(const char* str, std::string::size_type& i) { |
| 141 | OffsetPt res = utf8DecodeCheck(str, i); |
| 142 | if (res.offset < 0) { |
| 143 | i += 1; |
| 144 | return 0xFFFD; |
| 145 | } else { |
| 146 | i += res.offset; |
| 147 | return res.pt; |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | static inline void utf16Encode(char32_t pt, std::vector<char16_t>& out) { |
| 152 | if (pt < 0x10000) { |
no test coverage detected