Introducing YippieMove '09. Easy email transfers. Now open for all destinations.

As you guys have noticed by now we have done a little refresh of Playing With Wire. At the same time we choose to upgrade to WordPress 2.7 from WordPress 2.2.3.

Unfortunately early versions of WordPress did not specify UTF-8 encoding for the tables created in the database. After the upgrade, UTF-8 was in WordPress but our tables were still in Latin 1 and we got quite a collection of funny characters in some of our postings. Examples include “’” instead of a quotation mark, or  in the middle of some whitespace.

After searching for a while we found the solution at bawdo2001’s blog:

mysqldump -u root -p --opt --default-character-set=latin1 --skip-set-charset DBNAME > DBNAME.sql
sed -e 's/latin1/utf8/g' -i ./DBNAME.sql
mysql -p --default-character-set=utf8 DBNAME < DBNAME.sql

In other words, just dump the database in latin1, swap out latin1 for utf8 in the output SQL and then reimport in utf8. Just make sure you get a good backup of your database in a separate file before you start reimporting.

Author: Tags: , , , ,

© 2006-2009 WireLoad, LLC.
Logo photo by William Picard. Theme based on BlueMod © 2005 - 2009 FrederikM.de, based on blueblog_DE by Oliver Wunder.
Sitemap