Cannot display Greek characters .mdb file (PHP & ODBC)

依然范特西╮ 提交于 2020-01-11 12:49:05

问题


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


回答1:


.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.




回答2:


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);


来源:https://stackoverflow.com/questions/9135499/cannot-display-greek-characters-mdb-file-php-odbc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!