I have a problem with Unicode char. What I want is connect to Access mdb database from php, which is already done, and get some information. Everything is fine until I start to get questions marks char instead of unicode characters.
I have fixed this before in ASP by adding the follwoing code at the top of each page:
<%@LANGUAGE="JAVASCRIPT" CodePage=65001%>
However, I couldn’t find any similar solution for PHP.
Has anyone encounter this problem before?
Remember, I’m using PHP in Windows which has to connect to MS Access database.
I Also use the following two COMs to create connection and recordset:
COM('ADODB.Connection')
COM('ADODB.Recordset')
EDITED:
Is there any keyword which allows me to set chars into UTF-8?
Here’s the connection string which I use for all my connections
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=database.mdb;"
I have tried the following two and it seems MS Access doesn’t support charset at all.
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=database.mdb;character set=ISO8859_1;"
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=database.mdb;Charset=ISO8859_1;"
Need some help here please….
Thanks
Ali
So I guess nobody knows about this question. So I went and transfer all my data from MS Access to MySql. I also set utf8 as my main Collection in MySql. Then I create a class in PHP to connect to MySql and here’s the important part of code:
The important section of this code is the last line of
__constrcutmethod which indicates the type of charset of your connection. If you do not set that, You always get question mark characters instead of unicode characters.Hope it helps someone, somewhere.
Cheers,
Ali