MCPcopy Create free account
hub / github.com/asmuth/clip / convertUTF8To32

Method convertUTF8To32

src/utils/stringutil.cc:404–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404std::basic_string<char32_t> StringUtil::convertUTF8To32(
405 const std::basic_string<char>& str) {
406 std::basic_string<char32_t> out;
407
408 const char* cur = str.data();
409 const char* end = cur + str.length();
410 char32_t chr;
411 while ((chr = UTF8::nextCodepoint(&cur, end)) > 0) {
412 out += chr;
413 }
414
415 return out;
416}
417
418
419std::basic_string<char16_t> StringUtil::convertUTF8To16(

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected