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

Function validate_utf8_string

core/unicode.cpp:132–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132pair<bool, string::const_iterator> validate_utf8_string(const string& str) {
133 const auto end_iter = str.cend();
134 for(auto iter = str.cbegin(); iter != end_iter; ++iter) {
135 const auto code = decode_utf8_char(iter, end_iter);
136 if(!code.first) {
137 return { false, iter };
138 }
139 }
140 return { true, str.cend() };
141}
142
143#if defined(__APPLE__)
144string utf8_decomp_to_precomp(const string& str) {

Callers 1

Calls 3

decode_utf8_charFunction · 0.85
cendMethod · 0.45
cbeginMethod · 0.45

Tested by

no test coverage detected