Problems with post text after upgrading to WordPress 2.2

WordPress bloggers that have recently upgraded to WordPress version 2.2 may encounter strange character set or charset encoding problems where apostrophes, hyphens, quotation marks and dashes appear or are displayed in posts and pages as strange characters like ’, �., or even as simple ? (question marks). The symptom is obvious, your WordPress posts or pages will contains garbled, weird and funny characters, sometime just lots of ????? (question marks), rendering the WordPress database with your hard work useless and output unreadable. For many bloggers this problem can quickly become very frustrating. But before you revert back to an earlier version or wipe out and reinstall your database please read ahead as the solution is not so complicated.

WordPress 2.2 database character set and coalition problem:

Starting with WordPress version 2.2, the WordPress team has added the ability to define WordPress database character set and coalition values in the wp-config.php file. The database character set is set to utf8 by default. For people that are installing WordPress for the first time, this is fine. However most of us are upgrading from a previous version and this can pose a problem if our previous WordPress database (default database charset is Latin1) was not explicitly set as a Unicode UTF-8 charset collation.

How to fix the strange characters and corrupted text displayed on WordPress pages and posts:

  1. Access your WordPress directory via ftp
  2. Locate and open the WordPress wp-config.php file. Find and delete the following two lines:
  3. define('DB_CHARSET', 'utf8?);
    define('DB_COLLATE'=, ");

  4. Save your changes and go view your site

If all went well, the garbled, weird and funny characters should be gone. :)