我在 Access 文件中有泰文、日文、韩文字符(3 个字段)。
我在 PHP 中创建了一个脚本来连接到该文件
但显示的字符显示?????? ??????和 ??????
设置什么才能显示正常字符
这是我的脚本
<html>
<head>
<title>TEST</title>
</head>
<body>
<?
$objConnect = odbc_connect("test","","") or die("Error Connect to Database");
$strSQL = "SELECT * FROM table1";
$objExec = odbc_exec($objConnect, $strSQL) or die ("Error Execute [".$strSQL."]");
?>
<table width="600" border="1">
<tr>
<th width="20"> <div align="center">ID </div></th>
<th width="30"> <div align="center">Thai </div></th>
<th width="30"> <div align="center">Korea </div></th>
<th width="30"> <div align="center">Japan </div></th>
</tr>
<?
while($objResult = odbc_fetch_array($objExec))
{
?>
<tr>
<td><?=$objResult["ID"];?></div></td>
<td><?=$objResult["Thai"];?></td>
<td><?=$objResult["Korea"];?></td>
<td><?=$objResult["Japan"];?></div></td>
</tr>
<?
}
?>
</table>
<?
odbc_close($objConnect);
?>
</body>
</html>
<?
header('Content-Type: text/html;charset=utf-8');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TEST</title>
</head>
<title>TEST</title>
<body>
<?
$objConnect = odbc_connect("test","","") or die("Error Connect to Database");
odbc_exec($objConnect, "SET NAMES 'UTF8'");
odbc_exec($objConnect, "SET client_encoding='UTF-8'");
...
或者尝试排队:
<td><?=mb_convert_encoding($objResult["Japan"], "SJIS");?></td>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)