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

Function getNthCodepoint

Engine/source/core/strings/unicode.cpp:555–567  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

553
554//-----------------------------------------------------------------------------
555const UTF8* getNthCodepoint(const UTF8 *unistring, const U32 n)
556{
557 const UTF8* ret = unistring;
558 U32 charsseen = 0;
559 while( *ret && charsseen < n)
560 {
561 ret++;
562 if((*ret & 0xC0) != 0x80)
563 charsseen++;
564 }
565
566 return ret;
567}
568
569/* alternate utf-8 decode impl for speed, no error checking,
570 left here for your amusement:

Callers 1

reflowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected