-----------------------------------------------------------------------------
| 171 | |
| 172 | //----------------------------------------------------------------------------- |
| 173 | const 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 | //----------------------------------------------------------------------------- |
| 195 | const U32 convertUTF32toUTF16(const UTF32 *unistring, UTF16 *outbuffer, U32 len) |
nothing calls this directly
no test coverage detected