编码的MySQL数据我有以下PHP代码:PHP读取utf8_unicode_ci
<?php
mysql_connect("localhost","root","*****");
mysql_select_db("MyData");
$sql=mysql_query("select * from menu");
while($row=mysql_fetch_assoc($sql))
$output[]=$row;
print(json_encode($output));
mysql_close();
?>
我的数据的基础上被编码上utf8_unicode_ci。 所以当我在浏览器中读取输出时,拉丁字符呈现得很好,但是希腊字符显示为“???????”。当我从我的数据库读取数据时,会定期呈现。 有人可以帮我介绍一下我的php代码有什么用?
重复搜索它 – dynamic 2011-05-27 15:22:29
可能重复[MySQL更改编码后抛出错误](http://stackoverflow.com/questions/6097364/mysql-throws-error-after -changing-encoding) – Johan 2011-05-27 15:28:17