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

Function utf16Decode

valdi_core/src/valdi_core/cpp/Text/UTF16Utils.cpp:51–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51static inline char32_t utf16Decode(const char16_t* str, std::u16string::size_type& i) {
52 OffsetPt res = utf16DecodeCheck(str, i);
53 if (res.offset < 0) {
54 i += 1;
55 return 0xFFFD;
56 } else {
57 i += res.offset;
58 return res.pt;
59 }
60}
61
62static inline void utf8Encode(char32_t pt, std::vector<char>& out) {
63 if (pt < 0x80) {

Callers 2

utf16ToUtf8Function · 0.85
utf16ToUtf32Function · 0.85

Calls 1

utf16DecodeCheckFunction · 0.85

Tested by

no test coverage detected