Support » Fixing WordPress » WP character encoding problem (PHP5 on dreamhost.com)

  • Resolved zhangling

    (@zhangling)


    My WP service provider dreamhost.comhad upgraded from PHP4 to PHP5 last week, and it broke Unicode character display.

    Before the upgrade, everything works fine. I use MySQL 5.1.39 with below setting:
    MySQL charset: UTF-8 Unicode
    MySQL connection collation: utf8-unicode-ci

    My WP version is 2.8.5

    Any ideas why this related with PHP5?

    Thanks.
    Ling

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator 🚀

    Try upgrading to WordPress 2.9.2 first. Your currently version is full of bugs and publicly known security holes. If the upgrade doesn’t resolve the issue, we can work from there.

    Problem fixed. Upgrade to newer version does NOT help.

    The key problem is the ‘wp-config.php’ – there is a setting as below:

    define(‘DB_CHARSET’, ‘utf-8’);

    I checked WP document, and the example they gave is actually define(‘DB_CHARSET’, ‘utf8’).

    So I changed from ‘utf-8’ to ‘utf8’ and the problem fixed.

    Probably PHP 5 will not recognize ‘utf-8’ as a valid encoding.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator 🚀

    That makes sense, utf-8 is not a valid character set, but utf8 is.

    The value given in the core wp-config-sample.php file is define('DB_CHARSET', 'utf8'); so that must have been changed in your file at some point in the past.

    My wp-config.php has not been changed for a long time. Dreamhost WP hosting works perfect until they upgrade to PHP5.

    So I guess with PHP4, ‘utf-8’ is valid, but not for PHP5.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP character encoding problem (PHP5 on dreamhost.com)’ is closed to new replies.