| 291 | } |
| 292 | |
| 293 | static std::vector<uint32_t> codepoints_from_utf8(const std::string & utf8) { |
| 294 | std::vector<uint32_t> result; |
| 295 | size_t offset = 0; |
| 296 | while (offset < utf8.size()) { |
| 297 | result.push_back(codepoint_from_utf8(utf8, offset)); |
| 298 | } |
| 299 | return result; |
| 300 | } |
| 301 | |
| 302 | static std::vector<uint16_t> codepoint_to_utf16(uint32_t cp) { |
| 303 | std::vector<uint16_t> result; |