问题
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