indeed.
K64 has a halfhearted fix in place for that. UTF8 characters display as a [?] placeholder, which is not too useful but somewhat better than 㤲àéè garbage.
// halfassed UTF8 support
// uh, we don't have UTF8 shit in font.png...
function strlen_utf8($str)
{
$ret = 0;
$len = strlen($str)
for ($i = 0; $i < $len; )
{
$c = ord($str[$i++])
$ret++;
if ($c & 0x80)
{
$c &= 0xFC;
while ($c & 0x40)
{
$c <<= 1;
$i++;
}
}
}
return $ret;
}
function twrite_utf8($font,$x,$y,$l,$text)
{
global $img;
$x*=8;
$y*=8;
$text.='';
$len = strlen_utf8($text)
if($len<$l) $x+=($l-$len)*8;
$len = strlen($text)
$pos = 0;
for($i=0;$i<$len;)
{
$c = ord($text[$i++])
if ($c & 0x80)
{
if (!($c & 0x3C))
{
$c2 = ord($text[$i++])
$c = ($c2 & 0x3F) | (($c & 0x03) << 6)
}
else
{
$c &= 0xFC;
while ($c & 0x40)
{
$c <<= 1;
$i++;
}
$c = 0x7F;
}
}
ImageCopy($img,$font,$pos*8+$x,$y,($c&0xF)*8,($c>>4)*8,8,8)
$pos++;
}
}
probably could have used mb_strlen() instead of coding my own, but eh
____________________
Kuribo64 -
melonDS