View Full Version : Data are shown up as " ???? ??? ???? ??"

06-13-2005, 07:14 PM
Hello all

I have a big problem that has been preventing me from publishing my website for about a week ...

I have an arabic php website ... now arabic shown up when it's html ... while the data retrieved from the database are shown up as: "??? ????? ?? ?????" (question marks) ... I use two ways for displaying arabic:

<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
and a PHP code:

header('Content-Type: text/html; charset=cp1256'); // cp1256 = windows-1256
header('Content-Language: ar');
and this

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" lang="ar">

now with all of these codes, arabic data retrieved from the database still show up as question marks ??? ????? ??

I doubt that something is worng in the phpmyadmin.

In phpmyadmin, in other servers and on localhost, both Arabic (ar-win-1256) and Arabic (ar-utf-8) used to appear ... but after I uploaded phpmyadmin to "current server", it only showed the latter one which is: Arabic (ar-utf-8) ... so I had to choose it cuz it's the only choice, while I used to choose Arabic(ar-win-1256).

I chose "cp1256_general_ci" as a collation for the database and the table and the mysql connection collation.

now data in the database are shown in correct arabic format ... but when openning the webpage, it's ??? ?????? ?????

so ... what else can I do? I tried and tried and tried and nothing changed ...

Please help ...

06-13-2005, 07:32 PM
Remove the META element and change "header('Content-Type: text/html; charset=cp1256');" to this:

header('Content-Type: text/html; charset=utf-8');

06-14-2005, 10:38 AM
ok ... I forgot to tell you that I used each code alone, I mean, when I used the php code I removed the meta tag ...

about the utf-8 I tried it before and didn't work, and the worse it changed the html arabic data into some strange symbols.

any way ... I think I know where is the problem... it's in the database. I guess I have to drop the tables and then recreate them with an sql statment including the charset. but I am not sure cuz I've got two choises: cp1256_general_ci and cp1256_bin and I don't know what's the difference ...
and do I have to set the collations in the sql statment while inserting data?

please answer me ... Help me.