Thursday, 15 September 2011

php - Project conversion from ISO 8859-1 to UTF-8 -


I have coded a PHP project under ISO 8859-1, and for some technical reasons, I under UTF-8 I want to make the project sign. What is a better way to do this? I am afraid of losing special characters such as French letters and scared. Thanks for the advice

You can use shell command by using iconv from Latin 1 (ISO-8859-1) UTF-8

After this, you should make sure that PHP uses UTF-8 as the default encoding (if I am reminded correctly then default_encoding variable in php.ini) If not, Can be set with ini_set () for your project.

After this, you should change your database to UTF-8 or use a Quickfix (for MySQL) like this:

  mysql_query ("SET NAMES 'Utf8');  

For whatever framework you use, you can replace mysql_query () (if you use any one). Place in the primary file that contains all sections and accessories.


No comments:

Post a Comment