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

Function utf32ToUtf16

valdi_core/src/valdi_core/cpp/Text/UTF16Utils.cpp:222–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220
221 return std::make_pair(buffer.data(), buffer.size());
222}
223
224std::pair<const char*, size_t> utf32ToUtf8(const uint32_t* utf32String, size_t length) {
225 thread_local static std::vector<char> tBuffer;
226 auto& buffer = tBuffer;
227 buffer.clear();
228
229 for (std::u16string::size_type i = 0; i < length; i++) {
230 utf8Encode(utf32String[i], buffer);
231 }
232
233 return std::make_pair(buffer.data(), buffer.size());
234}
235

Callers 3

utf16StorageMethod · 0.85
newStringFromUtf32Function · 0.85
resolveParagraphsICUMethod · 0.85

Calls 4

countUtf32ToUtf16Function · 0.85
resizeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected