-----------------------------------------------------------------------------
| 100 | |
| 101 | //----------------------------------------------------------------------------- |
| 102 | const 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 | //----------------------------------------------------------------------------- |
| 125 | const U32 convertUTF16toUTF8( const UTF16 *unistring, UTF8 *outbuffer, U32 len) |
nothing calls this directly
no test coverage detected