Switching a web site to UTF-8: Difference between revisions
From ShawnReevesWiki
Jump to navigationJump to search
Line 2: | Line 2: | ||
===Steps=== | ===Steps=== | ||
#Convert all the existing data in every text field of every table in the database. | #Convert all the existing data in every text field of every table in the database. This is the toughest part, because data in a field may not match the declared character set of the field itself, so converting might mangle unexpected characters. It is mentioned in the tutorials below that one might convert the contents of a field to the declared character set of that field before converting it to UTF-8. | ||
#Convert all the html pages to declare UTF-8 as their encoding. | #Convert all the html pages to declare UTF-8 as their encoding. This is done in the META tag in the header. | ||
#Convert all php scripts to use UTF-8 as the default character set. | #Convert all php scripts to use UTF-8 as the default character set. | ||
#Convert all mysql connections and requests to use UTF-8. | #Convert all mysql connections and requests to use UTF-8. | ||
===Existing tutorials=== | ===Existing tutorials=== | ||
;Converting a MySQL database to UTF-8 | ;Converting a MySQL database to UTF-8 |
Revision as of 11:05, 16 April 2013
I'd enjoy a web site that had zero issues with characters rendered improperly, so I'm considering converting my web sites to use the UTF-8 character set for storage and presentation.
Steps
- Convert all the existing data in every text field of every table in the database. This is the toughest part, because data in a field may not match the declared character set of the field itself, so converting might mangle unexpected characters. It is mentioned in the tutorials below that one might convert the contents of a field to the declared character set of that field before converting it to UTF-8.
- Convert all the html pages to declare UTF-8 as their encoding. This is done in the META tag in the header.
- Convert all php scripts to use UTF-8 as the default character set.
- Convert all mysql connections and requests to use UTF-8.
Existing tutorials
- Converting a MySQL database to UTF-8
- http://www.drzycimski.com/programming/zend-framework/converting-a-mysql-database-to-utf-8/
- Converting Database Character Sets << WordPress Codex
- http://codex.wordpress.org/Converting_Database_Character_Sets