MCPcopy Create free account
hub / github.com/Snapchat/Valdi / utf8ToUtf32

Function utf8ToUtf32

valdi_core/src/valdi_core/cpp/Text/UTF16Utils.cpp:186–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185 return std::make_pair(buffer.data(), buffer.size());
186}
187
188std::pair<const char16_t*, size_t> utf8ToUtf16(const char* utf8String, size_t len) {
189 thread_local static std::vector<char16_t> tBuffer;
190 auto& buffer = tBuffer;
191 buffer.clear();
192
193 for (std::string::size_type i = 0; i < len;) {
194 utf16Encode(utf8Decode(utf8String, i, len), buffer);
195 }
196
197 return std::make_pair(buffer.data(), buffer.size());
198}
199

Callers 4

utf32StorageMethod · 0.85
utf8ToWStringMethod · 0.85
makeUTF32StringFunction · 0.85
TESTFunction · 0.85

Calls 4

utf8DecodeFunction · 0.85
clearMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45

Tested by 2

makeUTF32StringFunction · 0.68
TESTFunction · 0.68