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
186std::pair<const uint32_t*, size_t> utf8ToUtf32(const char* utf8String, size_t len) {
187 thread_local static std::vector<uint32_t> tBuffer;
188 auto& buffer = tBuffer;
189 buffer.clear();
190
191 for (std::string::size_type i = 0; i < len;) {
192 buffer.emplace_back(utf8Decode(utf8String, i));
193 }
194
195 return std::make_pair(buffer.data(), buffer.size());
196}
197
198std::pair<const uint32_t*, size_t> utf16ToUtf32(const char16_t* utf16String, size_t len) {
199 thread_local static std::vector<uint32_t> tBuffer;

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