WordPress Charset Encoding Problem After Upgrading to Version 2.2

WordPress blogs that upgraded to Wordpress version 2.2 may encounter strange character set (charset) encoding problem where several characters especially apostrophes (’), quotation marks (”), and hyphens or dashes (—) are displayed as strange characters such as ’ or simply as question marks (?) when the posts are output to web pages. As you have probably suspected, the issue is caused by character encoding method used by WordPress 2.2 which supports setting of database collation and character set in WordPress config file.

The error happens because up to and including WordPress ver 2.1.3, almost all WordPress databases were created using the latin1 character set and the latin1_swedish_ci collation. Beginning WordPress v2.2, WordPress allows the user to define both the database character set and the collation in wp-config.php file, using DB_CHARSET and DB_COLLATE values. With these values set to another encoding, WordPress assumes that the databases are indeed using the charset and collation too, where it’s not the case for existing WordPress installation. So if you’re upgrading WordPress to 2.2 using the default wp-config.php, or have manually modified the file to include the new variables, or upgrading by using Fantastico which automatically update the wp-config.php file to include these two definitions which values set as Unicode UTF-8 by default, you will need to remove these definitions to solve the character encoding error.

Open and edit your WordPress wp-config.php file. Then locate the following two lines:

define(’DB_CHARSET’, ‘utf8′);
define(’DB_COLLATE’, ”);

You can simply delete these 2 lines away, or just remove the utf8 from the first line to make them looks like this:

define(’DB_CHARSET’, ”);
define(’DB_COLLATE’, ”);

With no charset and collation values set, WordPress will fall back to the old default, latin1 which matched the databases.

A possible better solution is convert the Wordpress database to UTF8 Unicode.

Share and contribute or get technical support and help at My Digital Life Forums.



30 Responses to “WordPress Charset Encoding Problem After Upgrading to Version 2.2”

Pages: [2] 1 » Show All

  1. Endolith
    June 18th, 2008 08:42
    30

    Isn’t UTF8 much better? Why would you limit yourself to Latin1 just because it used to be the default?

  2. Tom Clarke
    June 6th, 2008 20:56
    29

    Just wanted to say: this had afflicted me for months. Never found a workable solution. Stumbled on your site today and it worked perfectly. Thanks so much!

  3. Josh
    February 19th, 2008 05:04
    28

    Hi, thanks for doing this. it’s the only thing I’ve found. I remove the utf8 and a lot of my posts still have the question marks. any ideas what I may need to do?

  4. Marthin
    February 17th, 2008 03:44
    27

    thanks for the help, it worked out for me :)

  5. Bruno Silva
    January 5th, 2008 06:55
    26

    Thx a lot!
    You saved me hours!

Pages: [2] 1 » Show All

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

wordpress charset - wordpress encoding - wordpress utf8 - wordpress utf-8 - wordpress db_charset - charset wordpress - wordpress apostrophe - wordpress character encoding - encoding wordpress - wordpress charset problem - utf8 wordpress - charset encoding - wordpress encoding problem - wordpress charset encoding - utf-8 wordpress - wordpress rss encoding - wordpress character - wordpress DB_COLLATE - wordpress utf - define('DB_CHARSET', 'utf8') wordpress - change wordpress encoding - encoding utf-8 vista yahoo mail - wordpress apostrophes - wordpress encoding error - wordpress change charset - wordpress post encoding - DB_CHARSET wordpress - convert quotation marks wordpress - wordpress "’" encoding - wordpress 2.5 latin to unicode problem - wordpress encoding problems - hungarian "character encoding" wordpress - wordpress weird characters - wordpress DB_COLLATE korean - wordpress charset encoding problem after - all - rendering apostrophe in wordpress - problem with Iphone after upgrading to version 2 - wordpress charset problem upgrade - wordpress 2.6 charset problema - encoding problems - wordpress 2.5 apostrophe - change wordpress charset - change charset wordpress - wordpress problem characters - wordpress utf encoding - character encoding wordpress - recent posts odd characters wordpress - wordpress apostrophe encoding error - wordpress character encoding issue -