Php Pdo select查询以不适当的方式返回列值(unicode问题)
我尝试使用以下代码使用pdo从db表检索所有数据:Php Pdo select查询以不适当的方式返回列值(unicode问题),php,mysql,unicode,pdo,Php,Mysql,Unicode,Pdo,我尝试使用以下代码使用pdo从db表检索所有数据: $stmt = $this->_db->query("SELECT * FROM ki_cities"); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); return $result; 它返回以下数组: [{“id”:“1”,“城市”:“\u10d7\u10d1\u10d8\u10da\u10d8\u10e1\u10d8”},{“id”:“2”,
$stmt = $this->_db->query("SELECT * FROM ki_cities");
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
它返回以下数组:
[{“id”:“1”,“城市”:“\u10d7\u10d1\u10d8\u10da\u10d8\u10e1\u10d8”},{“id”:“2”,“城市”:“\u10e5\u10e3\u10d7\u10d0\u10d8\u10e1\u10d8”},{“id”:“3”,“科蒂”:“\u10d1\u10d0\u10d7\u10e3\u10db\u10d8”]
问题是citie列的值实际上是city:“თელავი", 城市:“თბილისი,城市:გორი“(这是格鲁吉亚语)
我猜问题出在unicode中。数据库中的p.S.排序规则设置为utf8\U unicode\U ci(这是mysql中的多语言unicode)
如有任何建议,我们将不胜感激。
提前谢谢。解决了
我错过了一个步骤,我用json返回了这个数据,问题出在json_encode()中