mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Provide a safer version of convertUTF16toUTF8
This commit is contained in:
parent
a88339c219
commit
e3bbc42925
10 changed files with 31 additions and 25 deletions
|
|
@ -359,7 +359,7 @@ void StringBuffer::getCopy8(UTF8 *buff, const U32 buffSize) const
|
|||
{
|
||||
incRequestCount8();
|
||||
AssertFatal(mBuffer.last() == 0, "StringBuffer::get UTF8 - not a null terminated string!");
|
||||
convertUTF16toUTF8(mBuffer.address(), buff, buffSize);
|
||||
convertUTF16toUTF8N(mBuffer.address(), buff, buffSize);
|
||||
}
|
||||
|
||||
void StringBuffer::getCopy(UTF16 *buff, const U32 buffSize) const
|
||||
|
|
@ -408,7 +408,7 @@ void StringBuffer::updateBuffer8()
|
|||
{
|
||||
U32 slackLen = getUTF8BufferSizeEstimate();
|
||||
mBuffer8.setSize(slackLen);
|
||||
U32 len = convertUTF16toUTF8(mBuffer.address(), mBuffer8.address(), slackLen);
|
||||
U32 len = convertUTF16toUTF8N(mBuffer.address(), mBuffer8.address(), slackLen);
|
||||
mBuffer8.setSize(len+1);
|
||||
mBuffer8.compact();
|
||||
mDirty8 = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue