以下是我的php脚本:
<?php
$con = $con = mysql_connect("localhost","root","");
mysql_set_charset('utf8',$con);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ninelifes", $con);
$result = mysql_query("SELECT * FROM quotes ORDER BY quotations DESC LIMIT 21,1");
while($row = mysql_fetch_assoc($result))
{
$output[]= $row;
}
print json_encode($output);
mysql_close($con);
?>
这是印刷品:
“\ u00e4”是“ä”。好吧,问题是如何解决我的json打印的utf8解码?