| 76 | } |
| 77 | |
| 78 | vector<uint32_t> utf8_to_unicode(const string& str) { |
| 79 | vector<uint32_t> ret; |
| 80 | |
| 81 | const auto end_iter = str.cend(); |
| 82 | for(auto iter = str.cbegin(); iter != end_iter; ++iter) { |
| 83 | const auto code = decode_utf8_char(iter, end_iter); |
| 84 | if(!code.first) return ret; |
| 85 | ret.emplace_back(code.second); |
| 86 | } |
| 87 | |
| 88 | return ret; |
| 89 | } |
| 90 | |
| 91 | string unicode_to_utf8(const vector<uint32_t>& codes) { |
| 92 | string ret; |
no test coverage detected