Elliott C. Back: In Aere Aedificare

Long Rest Chernobyl / Tschernobyl

Posted in Politics, Health, Internationalization, Homeland Security, Photo, Chernobyl, Tschernobyl by Elliott Back on April 26th, 2006.

chernobyl-reactor.jpg

It’s the 20th year anniversary of the worst nuclear accident in the history of mankind. Pray the concrete sarcophagus holds, and the years of rain and animal infestation have not torn it completely away, as some speculate.

Wordpress 2.0 Upgrade Problems: Character Encoding + Transformation

Posted in Blogging, My Blog, Code, Internationalization, Wordpress, Encodings by Elliott Back on April 3rd, 2006.

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:

whoah-weird-wordpress-chars.jpg

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…