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

Function validate_utf8_string

src/core/unicode.cpp:138–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138std::pair<bool, std::string::const_iterator> validate_utf8_string(const std::string& str) {
139 const auto end_iter = str.cend();
140 for(auto iter = str.cbegin(); iter != end_iter; ++iter) {
141 const auto code = decode_utf8_char(iter, end_iter);
142 if(!code.first) {
143 return { false, iter };
144 }
145 }
146 return { true, str.cend() };
147}
148
149#if defined(__APPLE__)
150std::string utf8_decomp_to_precomp(const std::string& str) {

Callers 1

Calls 3

decode_utf8_charFunction · 0.85
cendMethod · 0.45
cbeginMethod · 0.45

Tested by

no test coverage detected