MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / oneUTF32toUTF16

Function oneUTF32toUTF16

engine/source/string/unicode.cc:481–493  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

479
480//-----------------------------------------------------------------------------
481const UTF16 oneUTF32toUTF16(const UTF32 codepoint)
482{
483 // found a codepoint outside the codeable UTF-16 range!
484 // or, found an illegal codepoint!
485 if(codepoint >= 0x10FFFF || isSurrogateRange(codepoint))
486 return kReplacementChar;
487
488 // these are legal, we just dont want to deal with them.
489 if(isAboveBMP(codepoint))
490 return kReplacementChar;
491
492 return (UTF16)codepoint;
493}
494
495//-----------------------------------------------------------------------------
496const U32 oneUTF32toUTF8(const UTF32 codepoint, UTF8 *threeByteCodeunitBuf)

Callers 6

AndroidFont.cppFile · 0.85
EmscriptenFont.cppFile · 0.85
isValidCharMethod · 0.85
x86UNIXFont.ccFile · 0.85
convertUTF8toUTF16Function · 0.85
convertUTF32toUTF16Function · 0.85

Calls 2

isSurrogateRangeFunction · 0.85
isAboveBMPFunction · 0.85

Tested by

no test coverage detected