I have a website with Arabic content that has been migrated from another server. Everything was displayed correctly on the old server, presumably everything was encoded in UTF-8.
On the current server, data began to display incorrectly, showing Ü † Ø¨Ø ° Ø © ع٠† and similar symbols.
The application is based on CakePHP Framework.
After many tests, I changed the parameter 'encoding'in the MySql connection array to become latin1 . For people who don’t know CakePHP, this sets up the MySql connection encoding. Setting this value to UTF8 did not change anything even after the steps described below.
Some of the entries began to display correctly in Arabic, while others remained gibberish.
I have already passed the verification of the entire database and server, confirming that:
- The created database is UTF-8.
- UTF-8 table.
- The columns do not explicitly indicate any encoding encoded in UTF-8.
- The default character set in PHP is UTF-8
- Mysql.cnf default settings for UTF-8
After that, I extracted my data and stuck on it, printing the encoding of each line (from each line) with mb_detect_encoding. Lines that display correctly return UTF8 until they return nothing for damaged lines.
- , , . , 2 , , - UTF-8 latin1.
, mb_detect_encoding , ?
UPDATE: , , , my.cnf .
:
- = utf8
- = utf8
, , .
, , , , , , , .