大家好:
我連mysql是正常中文字,但改用access中文就會變亂碼,想請問有甚麼方法可以解決嗎?
謝謝
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title></title>
</head>
<body>
<div id="content">
<?php
try {
$db = new PDO("odbc:driver={microsoft access driver (*.mdb)};dbq=".realpath("test.mdb").";charset=UTF-8") or die("Connect Error"); //這裡有加UTF-8
$rs = $db->query('select * from administrator');
print "<pre>";
print_r($rs->fetchAll());
print "</pre>";
}
catch(PDOException $e){
echo $e->getMessage();
}
?>
</div>