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

Function utf16ToUtf32

valdi_core/src/valdi_core/cpp/Text/UTF16Utils.cpp:198–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196
197 return std::make_pair(buffer.data(), buffer.size());
198}
199
200std::pair<const uint32_t*, size_t> utf8ToUtf32(const char* utf8String, size_t len) {
201 thread_local static std::vector<uint32_t> tBuffer;
202 auto& buffer = tBuffer;
203 buffer.clear();
204
205 for (std::string::size_type i = 0; i < len;) {
206 buffer.emplace_back(utf8Decode(utf8String, i, len));
207 }
208
209 return std::make_pair(buffer.data(), buffer.size());
210}
211

Callers 1

utf32StorageMethod · 0.85

Calls 4

utf16DecodeFunction · 0.85
clearMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected