Web Hosting Talk







View Full Version : mysql and arabic


kooshin
12-27-2006, 03:59 PM
hello guys i need your help.

How can mysql display Arabic well. Right now it is displaying them as ??????? . I'm using mambo and everyting is working fine on the local server but when online all i see is question marks .

here is the server info

Server version: 4.1.21-standard
Protocol version: 10
Server: Localhost via UNIX socket
User: islamic@localhost
MySQL charset: UTF-8 Unicode (utf8)


the local server of the mysql is MySQL 4.0.24-nt .


how can i fix this problem?

Thanks in advance.

azizny
12-27-2006, 05:11 PM
This is one of the oldest problems.

I recommend you use UTF-8.

Here is what you do:

* Make database/forums and text/varchar fields all utf charset.

After connecting to the database use this query:


mysql_query("SET NAMES `utf8`");


It should all work fine. If not, you are doing something wrong :D

Peace,

kooshin
12-28-2006, 10:39 AM
hi thanks for the reply. it is all UTF-8. There is another problem, the person has to change the browser encoding to UTF-8 in order to see the arabic text. Is there a way to fix this?

I mean make it default so that the person don't have to change anything. Even when I change the browser encoding to UTF-8 then click on a link then I have to change it again for that page.

thanks again

azizny
12-28-2006, 12:18 PM
Yes, use meta tag charset.


<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


Peace,

kooshin
12-28-2006, 02:29 PM
that was there before but i think i'm missing something. It was a file . Now everything looks to be fixed. Thanks for your help