Unicode Bug in GuiTextListCtrl
by Ian Omroth Hardingham · in Torque Game Engine · 11/22/2007 (8:00 am) · 1 replies
Hey guys.
GuiTextListCtrl::renderCell does not function properly with UTF8s. Paul Dana and I cooked up a quick hack for it. Basically, change:
at line 280-ish
to
and also put
at the top.
Ian
GuiTextListCtrl::renderCell does not function properly with UTF8s. Paul Dana and I cooked up a quick hack for it. Basically, change:
if(nextCol)
slen = nextCol - text;
else
slen = dStrlen(text);at line 280-ish
to
if (nextCol)
{
*nextCol = 0;
U32 numCodePoints, bufferLen;
bufferLen = dStrlen(text)+1; // Need the +1 to hold the NULL
UTF16 *buffer16 = new UTF16[bufferLen]; // need len * 2 bytes == len * sizeof(UTF16)
numCodePoints = convertUTF8toUTF16(text, buffer16, bufferLen);
slen = numCodePoints;
*nextCol = '\t';
}
else
{
slen = dStrlen(text);
}and also put
#include "core/unicode.h"
at the top.
Ian
About the author
Designer and lead programmer on Frozen Synapse, Frozen Endzone, and Determinance. Co-owner of Mode 7 Games.
Associate Ian Omroth Hardingham
Mode 7 Games
and
which were both const previously.