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

Function utf8Decode

valdi_core/src/valdi_core/cpp/Text/UTF16Utils.cpp:140–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static inline char32_t utf8Decode(const char* str, std::string::size_type& i) {
141 OffsetPt res = utf8DecodeCheck(str, i);
142 if (res.offset < 0) {
143 i += 1;
144 return 0xFFFD;
145 } else {
146 i += res.offset;
147 return res.pt;
148 }
149}
150
151static inline void utf16Encode(char32_t pt, std::vector<char16_t>& out) {
152 if (pt < 0x10000) {

Callers 2

utf8ToUtf16Function · 0.85
utf8ToUtf32Function · 0.85

Calls 1

utf8DecodeCheckFunction · 0.85

Tested by

no test coverage detected