MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / oneUTF32toUTF16

Function oneUTF32toUTF16

Engine/source/core/strings/unicode.cpp:430–442  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

428
429//-----------------------------------------------------------------------------
430UTF16 oneUTF32toUTF16(const UTF32 codepoint)
431{
432 // found a codepoint outside the encodable UTF-16 range!
433 // or, found an illegal codepoint!
434 if(codepoint >= 0x10FFFF || isSurrogateRange(codepoint))
435 return kReplacementChar;
436
437 // these are legal, we just don't want to deal with them.
438 if(isAboveBMP(codepoint))
439 return kReplacementChar;
440
441 return (UTF16)codepoint;
442}
443
444//-----------------------------------------------------------------------------
445U32 oneUTF32toUTF8(const UTF32 codepoint, UTF8 *threeByteCodeunitBuf)

Callers 3

convertUTF8toUTF16NFunction · 0.85
isValidCharMethod · 0.85
X11Font.client.cppFile · 0.85

Calls 2

isSurrogateRangeFunction · 0.85
isAboveBMPFunction · 0.85

Tested by

no test coverage detected