Page 1 of 1

PHP & MySQL Charset Issue

Posted: Tue Nov 25, 2008 6:30 am
by daredevil14
Hello,

i have a database that contains arabic data, note that its default charset is UTF8, the default collation is UTF8 too, and when querying doing this :

Code: Select all

mysql_query("SET NAMES 'UTF8'"); 
mysql_query('SET CHARACTER SET UTF8');
and the page that outputs data is set to UTF8

My problem is when entering data from an HTML form to the MySQL db ( note that it is done through AJAX, and the charset of the ajax script is UTF8 too )
when the new arabic data are inserted, they look like "%u0646%u0645" both in the database and in the HTML page, now i tried to use the above php script when querying the insert of the new data but nothing worked...

So what's the problem ?

Re: PHP & MySQL Charset Issue

Posted: Wed Nov 26, 2008 3:54 am
by daredevil14
any help?

Re: PHP & MySQL Charset Issue

Posted: Wed Nov 26, 2008 4:37 am
by Eran
you need to provide more details, such as the code the outputs the text and the markup of the html page.