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 :

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 ?

    In your AJAX javascript, do you use the encode() JS function? If so, try using encodeURI() instead.

      No, i dont use it, i just send my data under POST which requires to specify the xmlhttp.setrequestheader, and within it i choose UTF8, notice that if i enter arabic data in PHPMyAdmin web interface, the browser then, outputs correct arabic characters on the wanted page, but if i input arabic data in the wanted page through its form, it then, goes wrong!!

        Write a Reply...