MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Utf16DecodeChar

Function Utf16DecodeChar

src/string_func.h:96–103  ·  view source on GitHub ↗

* Decode an UTF-16 character. * @param c Pointer to one or two UTF-16 code points. * @return Decoded Unicode character. */

Source from the content-addressed store, hash-verified

94 * @return Decoded Unicode character.
95 */
96inline char32_t Utf16DecodeChar(const uint16_t *c)
97{
98 if (Utf16IsLeadSurrogate(c[0])) {
99 return Utf16DecodeSurrogate(c[0], c[1]);
100 } else {
101 return *c;
102 }
103}
104
105/**
106 * Is the given character a text direction character.

Callers 2

NextMethod · 0.85
PrevMethod · 0.85

Calls 2

Utf16IsLeadSurrogateFunction · 0.85
Utf16DecodeSurrogateFunction · 0.85

Tested by

no test coverage detected