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

Function convertUTF8toUTF32

engine/source/string/unicode.cc:102–122  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

100
101//-----------------------------------------------------------------------------
102const U32 convertUTF8toUTF32(const UTF8 *unistring, UTF32 *outbuffer, U32 len)
103{
104 AssertFatal(len >= 1, "Buffer for unicode conversion must be large enough to hold at least the null terminator.");
105 PROFILE_START(convertUTF8toUTF32);
106 U32 walked, nCodepoints;
107
108 nCodepoints=0;
109 while(*unistring != 0 && nCodepoints < len)
110 {
111 walked = 1;
112 outbuffer[nCodepoints] = oneUTF8toUTF32(unistring,&walked);
113 unistring+=walked;
114 nCodepoints++;
115 }
116
117 nCodepoints = getMin(nCodepoints,len - 1);
118 outbuffer[nCodepoints] = '\0';
119
120 PROFILE_END();
121 return nCodepoints;
122}
123
124//-----------------------------------------------------------------------------
125const U32 convertUTF16toUTF8( const UTF16 *unistring, UTF8 *outbuffer, U32 len)

Callers

nothing calls this directly

Calls 4

oneUTF8toUTF32Function · 0.85
getMinFunction · 0.85
dStrlenFunction · 0.70
dMemcpyFunction · 0.50

Tested by

no test coverage detected