MCPcopy Create free account
hub / github.com/aseprite/laf / utf16_to_codepoint

Function utf16_to_codepoint

base/string.cpp:128–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128codepoint_t utf16_to_codepoint(const uint16_t low, const uint16_t hi)
129{
130 // Valid code point
131 if ((low >= 0x0000 && low <= 0xD7FF) || (low >= 0xE000 && low <= 0xFFFF)) {
132 return codepoint_t(low);
133 }
134
135 // Surrogate pair
136 if (low >= 0xDC00 && low <= 0xDFFF) {
137 ASSERT(hi >= 0xD800 && hi <= 0xDBFF);
138 return (0x10000 | (((low - 0xDC00)) | ((hi - 0xD800) << 10)));
139 }
140
141 return 0;
142}
143
144#ifdef LAF_WINDOWS
145

Callers 1

commitRunBufferMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected