The Wordpress 2.0 upgrade.php script in the wp-admin folder is designed to convert older copies of your database from older versions of Wordpress. However, there’s something wrong with the character encoding, or the collation (latin1_swedish_ci). Changing the collation after the fact doesn’t affect the improper characters being passed back, so I assume it would need to be set before migration. Here’s an example of what it looks like:
After the damage has occured, the best way, it seems, to clean this up is to run multiple SQL queries in the phpmyadmin console emulating find/replace on the wp_posts table:
UPDATE wp_posts SET post_content = replace(post_content, "bad", "good")
This has to be done for each character. So far, I’ve noticed apostrophe marks, the left and right quotation marks, all kinds of dashes, and ellipsis are affected.� It’s like it got run through the WP filters before it went back into the database.
It’s weird that my UTF-8 encoding has switched itself over to ISO-8859-1 all by itself…
|This entry was posted on Monday, April 3rd, 2006 at 5:55 pm and is tagged with sql queries, character encoding, collation, ellipsis, utf 8, older versions, dashes, quotation, migration, phpmyadmin, transformation, wp. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.|