Support » Fixing WordPress » Special Characters Not Displaying Correctly

  • I just upgraded from WP 2.2.2 to 2.7 using incremental upgrades. WP 2.7 seems to be working fine. My only problem is that special characters are not displaying properly. In my old WordPress, the characters displayed fine whether I used straight quotes or curly quotes in the original posts. Now curly quotes and apostrophes, copyright symbols, etc. that used to display fine in previous pages and posts are no longer displaying correctly.

    Example: A curly starting quote in the original now displays as ‘“’. A curly ending quote in the original now displays as ‘”’. An apostrophe displays as ‘’’. A dash dipslays as ‘–’.

    Looking through the other posts on this forum, it seems that other people are also having trouble with special characters – something to do with Collate function in the database?

    I checked my wp-config.php file and it has the following:

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

    I checked my Database in phpMyAdmin, and my database collation is: “latin1_swedish_ci” (I don’t remember seeing that before). I selected the database, selected “Operations,” and under “Collation” at the bottom, I selected “utf8_general_ci”, and pressed “Go.” I went back to the database table, and the SUM at the bottom of the Collation column now says “”utf8_general_ci” but all the individual tables still say “latin1_swedish_ci”.

    I checked my blog and the special characters still do not display. Here is an example page: (Sorry it is a sermon, I am not trying to preach to you guys, but all my problem pages are sermons that I copied and pasted into the blog from Microsoft Word. They used to display fine, but now they are not with the new upgrade to 2.7)

    Am I on the right track here, and if so what do I do next to fix this? Or if I am on the wrong track, can someone put me on the right track? Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Okay, I have some more information on this. I tried a test post using special characters and it posted fine. My problem is even worse. I went to edit the page I linked to up above, and all the garbage characters are actually in the source version of the post. Apparently all my old posts and pages with special characters have been transformed into these garbage characters. Is there anyway to change them back? (Other than manually editing thousands of changes)?

    Okay, I have been busy working on this. I finally arrived at a solution using an OLD plugin: UTF-8 Database Converter ( After installing the plugin on my WordPress 2.7, I got all sorts of warnings saying this was only tested up to 2.2. However, I was all backed up, so I went ahead and tried it, and now all the funny characters seem to be gone from my blog. In other words, it worked!

    This article in the Codex: Converting Database Character Sets ( “This plugin corrupts data in modern versions of WordPress,” however, everything seems to be working fine.

    Call me crazy, but I think there’s something up with WordPress (or perhaps the Backup plugin). I am working on moving my WP database to a new domain (on the same server). I took a backup of the database with the DB Backup plugin and created a new database (using the same defaults as the current database).

    Without other changes, a page having special characters (in my case left and right curly quotes) that displayed fine on my current domain displays on the new domain the same special characters as you are talking about in your posts.

    Same mysql, same version of wordpress, same character set variables (show variables), same settings in wp-config.php, doesn’t matter what theme (characters show up right in admin on old, wrong in new).

    I am a little perplexed, but in my case there are only a few cases (curly quotes that came in from copy/paste) so I’ll just manually fix them. But something is getting messed up, presumably either in the dump or load.


    Hey all,

    I noticed this very same issue. I thought it was a problem with my db (backed up using mysqldump), but I found a simple fix (for my situation).

    So all I did was move to a new hosting provider, and my curly quotes all got messed up.

    I noticed that my old wp-config.php had the following line commented out:

    /** Database Charset to use in creating database tables. */

    #define(‘DB_CHARSET’, ‘utf8’);

    In my current config that “define” line was not commented out.

    Simply commenting out that define fixed my quoting issue.

    To comment out just put “//” or “#” in front of the line (i dunno which is the proper php way, both seem to work)

    It’s worth a try anyhow if you have this define in your wp-config.php.


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Special Characters Not Displaying Correctly’ is closed to new replies.