MYSQL charset issue

We were using XAMPP for development earlier - we had built an Application on it. Then we have move to an environment where we have configured Apache / MYSQL and PHP seprately and manually on Windows 7 machine. Now when we have shifted our application , all the arabic text are showing likfe this on the application - خدمة تنظيف وتقطيع السمك

I am already using UTF8 charset in the HTML header but no use.

Is there a configuration difference between the two database servers?

No idea about it.

First of all, it have to be HTTP header, not HTML.
Check charset that is sent by the server in the Content-type header.

Two possibilities:

  1. Your application does not set connection charset. In you php code you need to set the database connection charset to utf8 upon connecting. If you don’t do this then the mysql server default will be used - and the default may be different on your new installation.

  2. The data has been migrated incorrectly. The database connection charset is very important and it should be properly set both when exporting and when importing the database. Otherwise you will end up in corrupt characters. If that is the case you should move the data again in the proper way - if it is impossible then if you are lucky you may be able to bring back the corrupt characters by using laborious search and replace in your tables (UPDATE…) but sometimes it may not be possible depending on how the data was exported/imported.

A little correction. utf8 it should be for mysql.

Indeed - corrected!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.