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

Function convertUTF32toUTF8

engine/source/string/unicode.cc:173–192  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

171
172//-----------------------------------------------------------------------------
173const U32 convertUTF32toUTF8( const UTF32 *unistring, UTF8 *outbuffer, U32 len)
174{
175 AssertFatal(len >= 1, "Buffer for unicode conversion must be large enough to hold at least the null terminator.");
176 PROFILE_START(convertUTF32toUTF8);
177 U32 nCodeunits, codeunitLen;
178
179 nCodeunits=0;
180 while( *unistring != '\0' && nCodeunits + 3 < len )
181 {
182 codeunitLen = oneUTF32toUTF8(*unistring, &outbuffer[nCodeunits]);
183 unistring++;
184 nCodeunits += codeunitLen;
185 }
186
187 nCodeunits = getMin(nCodeunits,len);
188 outbuffer[nCodeunits] = '\0';
189
190 PROFILE_END();
191 return nCodeunits;
192}
193
194//-----------------------------------------------------------------------------
195const U32 convertUTF32toUTF16(const UTF32 *unistring, UTF16 *outbuffer, U32 len)

Callers

nothing calls this directly

Calls 4

oneUTF32toUTF8Function · 0.85
getMinFunction · 0.85
dStrlenFunction · 0.70
dMemcpyFunction · 0.50

Tested by

no test coverage detected