无法显示希腊字符 .mdb 文件(PHP 和 ODBC)

发布于 2025-01-02 07:22:35 字数 329 浏览 1 评论 0原文

我在显示 MS Access 2007 表中希腊语列中的文本时遇到问题。我正在使用 PHP 和 $dbc = @odbc_pconnect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $pass); 从本地读取.mdb 文件。我可以成功读取数据库中拉丁字符的其余数据。当我回显结果时,希腊字符显示为 。 html 字符集已正确设置为 utf-8。我尝试过使用 utf8_encode 但没有成功。我在网上搜索了一段时间没有但无法弄清楚。

任何帮助将不胜感激。

凯里斯

I am having problems displaying text from a column in an MS Access 2007 table which is in Greek. I am using PHP and $dbc = @odbc_pconnect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $pass); to read from a local .mdb file. I can successfully read the rest of the data in the DB which is in Latin characters. Greek characters get displayed as when I echo the results. The html charset is properly set to utf-8. I've tried using utf8_encode with no luck. I've been searching the web for some time no but could not figure it out.

Any help would be appreciated.

Kyris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

め七分饶幸 2025-01-09 07:22:35

.mdb 格式是 Microsoft 的发明,不使用 Unicode,而是使用 Windows- 代码页之一。检查您使用的是哪一个希腊语,然后使用 iconv 进行翻译编码之间。

.mdb format, being a Microsoft's invention does not use Unicode, but rather one of Windows- codepages. Check which one is that you use for Greek, and use iconv to translate between encodings.

与他有关 2025-01-09 07:22:35

举个例子:

echo 'TRANSLIT : ', iconv("Windows-1253", "UTF-8//TRANSLIT", $text);
echo 'IGNORE   : ', iconv("Windows-1253", "UTF-8//IGNORE", $text);
echo 'Plain    : ', iconv("Windows-1253", "UTF-8", $text);

As an exmple:

echo 'TRANSLIT : ', iconv("Windows-1253", "UTF-8//TRANSLIT", $text);
echo 'IGNORE   : ', iconv("Windows-1253", "UTF-8//IGNORE", $text);
echo 'Plain    : ', iconv("Windows-1253", "UTF-8", $text);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文