0

I had problem encoding traditional/simplified Chinese character with php. I've done quite some research but

mysql_set_charset('utf8');
header("content-type:text/html; charset=utf8");

didn't work for me

changey
  • 18,606
  • 9
  • 28
  • 34

2 Answers2

0

use this code on top of your page:

header('Content-Type: text/html; charset=utf-8');
Mani
  • 888
  • 6
  • 19
0

Found the following answer works for me.

Traditional Chinese

    mysql_set_charset('big5');
    header("content-type:text/html; charset=big5");

    $stack = array();
    $data = array("id" => $row[0], "name" => urlencode("台灣"));
    array_push($stack, $data);
    $json = urldecode(json_encode($stack));
    echo $json;

Simplified Chinese

change the 'big5' to 'gbk'

changey
  • 18,606
  • 9
  • 28
  • 34