当我使用PHP ODBC从MS Access数据库中获取数据时,utf8字符(č,ć,ž,š,đ)存在问题。有什么方法可以输出带UTF-8字符的数据?
<?php
$conn = odbc_connect('access', '', '');
if($conn){
$query = "SELECT * FROM tablica1";
$rs = odbc_exec($conn, $query);
$response = array();
while($row = odbc_fetch_array($rs)) {
$response[] = $row;
}
echo '<pre>'; print_r($response); echo '</pre>';
}
?>
输出:
Array
(
[0] => Array
(
[ID] => 14
[Ime] => Test1
[Prezime] => Test2
)
[1] => Array
(
[ID] => 15
[Ime] => Test�
[Prezime] => Test�
)
)