MCPcopy Create free account
hub / github.com/a2flo/floor / utf8_to_unicode

Function utf8_to_unicode

core/unicode.cpp:78–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78vector<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
91string unicode_to_utf8(const vector<uint32_t>& codes) {
92 string ret;

Callers 1

handle_eventsMethod · 0.85

Calls 3

decode_utf8_charFunction · 0.85
cendMethod · 0.45
cbeginMethod · 0.45

Tested by

no test coverage detected