WordPress loves UTF-8

WordPress loves UTF-8

Well, my blog was windows-1251. Terrible, isn’t it? Almost everyday I talk around that every project on the web should be unicode, but my own blog was not UTF-8 encoded. The problem was the collected cp-1251 content.

Today the conversion has been done. The procedure is very simple:

  1. Backup your current database
    mysqldump --opt -u user --password="pass" dbname > wpdb.sql
  2. Convert your dump file with iconv
    iconv -f WINDOWS-1251 -t UTF-8 wpdb.sql > wp-conv.sql
  3. Drop your current database and re-create it again. Leave it empty.
  4. Import converted dump file into new database.
    mysql -p dbname < wp-conv.sql
  5. Set your WordPress (Options – Reading – Encoding) to use UTF-8 enconding
  6. Enjoy
Йовко Ламбрев

Йовко Ламбрев

ИТ архитект, блогър и (все по-рядко) фотограф. Либерал. Все още вярва, че можем да направим света по-добър.
Пловдив, България