0
我想在PHP中的SQL查詢。我正在?????而不是Unicode字符。我經歷了谷歌和stackoverflow,我有很多解決方案,我嘗試了所有這些,但仍然沒有得到正確的結果。但是當我嘗試所有這些?走了,但我得到了「\ u0cb8 \ u0cc1 \ u0cb3 \ u0ccd \ u0caf \ u0ca6 \ u0c95 \ u0cc6 \ u0cb2 \ u0cb5 \ u0」。unicode字符顯示錯誤在PHP SQL查詢結果
<?php
//header('Content-Type: text/html; charset=utf-8');
$con = mysql_connect("host","uname","[email protected]");
//mysql_query("SET NAMES 'utf8'" ,$con);
//mysql_set_charset('utf8', $con);
//mysql_set_charset('utf8');
//mysql_query ("set collation_connection='utf8_general_ci'");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
//mysql_query ("set character_set_results='utf8'");
//mysql_query("SET NAMES utf8");
$result = mysql_query("SELECT * FROM node");
while($row = mysql_fetch_assoc($result))
{
$output[]=$row;
}
//utf8_encode($output);
print(json_encode($output));
//print_r $output;
mysql_close($con);
?>
評論行是我試過的解決方案。
是的,我試過在我的頭上。 http://app.sullia.in/full.php –