I just converted the WordPress database to UTF-8. It turned out when I create a database on my hosting website it defaults to latin1. The conversion was pretty easy in just a few steps.
These are the steps I took.
- Export the database. I used phpMyadmin and just ran an export to a file name mine.sql
- To convert the data in the database I ran :
iconv -f ISO-8859-1 -t utf8 mine.sql > mine-utf8.sql - Opened the mine-utf8.sql in VI and ran:
%s/CHARSET=latin1/CHARSET=utf8/ - Created a new database with the UTF-8 settings.
- Added the appropriate rights for the new database to the existing MySQL user I use for WordPress.
- Imported the data int the new database using the mine-utf8.sql file.
- Changed wp-config.php to use the new database.
(iconv was installed on my Linux box)
And that was it.
Of course you could drop the existing database and create it as UTF-8 but I rather had a security in case the conversion didn’t work.
Tags: charset, conversion, latin, Linux, MySQL, utf 8, WordPress







Entries (RSS)