Jump to content

Chinese output, I want english


shanie93

Recommended Posts

My script keeps displaying the names in Chinese, here's what I'm using;



$charcount = unpack( "c", substr( $buf, $start, 1 ) );
$start = $start+1;
for($MorzE=0; $i<$charcount[1]; $i++)
{
$charid = unpack( "N", substr( $buf, $start, 4 ) );
$start = $start+4;
$namelarge = unpack( "c*", substr( $buf, $start, 1 ) );
$start = $start+1;
$name = iconv( "UTF-16", "UTF-8", substr( $buf, $start, $namelarge[1] ) );
$start = $start+$namelarge[1];
if ($charid[1] == $_SESSION['charid'])
{
$select[$i] = ' selected="selected"';
}
$roles_acc .= <<<HTML
<option value='{$charid[1]}'{$select[$i]}>{$name}</option>\n

<select name="role">{$roles_acc}</select><br /><br />

My Database is set to General utf-8, I have tried changing that to several different types. I've also tried adding



header('Content-Type: text/html; charset=utf-8');

But it's still displaying in Chinese, any idea why?


Link to comment
https://forums.phpfreaks.com/topic/296549-chinese-output-i-want-english/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.