This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / Chinese Encoding Issue from MYSQL to PHP to JavaScript.I have Chinese in MYSQL database. I can see it and query it, no problem. After retrieve data by PHP and convert to JavaScript array, all successful but Chinese characters. They becomes "??".
JavaScript has no problem to handle the Chinese characters. I guess something wrong on PHP coding. Please help.
-registereduser(立牌坊);
2009-11-24
{307}
(#5702407@0)
-
Try set character_connection_set=gbk, character_result_set= gbk
-whereismyid(到处找ID);
2009-11-24
(#5702826@0)
-
中文显示了。非常感谢你的帮助。$query = sprintf( 'SET CHARACTER_SET_CONNECTION = UTF8');
mysql_query($query, $GLOBALS['DB']);
$query = sprintf( 'SET CHARACTER_SET_RESULTS = UTF8');
mysql_query($query, $GLOBALS['DB']);
在HTML里:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF8">
-registereduser(立牌坊);
2009-11-24
{302}
(#5703884@0)