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

Function convertUTF16toUTF32

engine/source/string/unicode.cc:150–170  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

148
149//-----------------------------------------------------------------------------
150const U32 convertUTF16toUTF32(const UTF16 *unistring, UTF32 *outbuffer, U32 len)
151{
152 AssertFatal(len >= 1, "Buffer for unicode conversion must be large enough to hold at least the null terminator.");
153 PROFILE_START(convertUTF16toUTF32);
154 U32 walked, nCodepoints;
155
156 nCodepoints=0;
157 while( *unistring != '\0' && nCodepoints < len )
158 {
159 walked=1;
160 outbuffer[nCodepoints] = oneUTF16toUTF32(unistring,&walked);
161 unistring += walked;
162 nCodepoints++;
163 }
164
165 nCodepoints = getMin(nCodepoints,len);
166 outbuffer[nCodepoints] = '\0';
167
168 PROFILE_END();
169 return nCodepoints;
170}
171
172//-----------------------------------------------------------------------------
173const U32 convertUTF32toUTF8( const UTF32 *unistring, UTF8 *outbuffer, U32 len)

Callers

nothing calls this directly

Calls 4

oneUTF16toUTF32Function · 0.85
getMinFunction · 0.85
dStrlenFunction · 0.70
dMemcpyFunction · 0.50

Tested by

no test coverage detected