WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] UTF-8 characters showing up as garbage in database (3 posts)

  1. jbiesnecker
    Member
    Posted 3 years ago #

    Hello everyone,

    I have a newly installed copy of WordPress 3.01 (on Dreamhost via the auto installer, if that makes any difference), and I have Chinese text in my entries. Everything is fine on the frontend, the Chinese displays fine, no worries. However, when I look in the database, all of the characters are turned into garbage (i.e., é±¼ instead of 鱼). This is a problem when I want to run custom queries on the post_title field, because select * from wp_posts where post_title = '鱼' doesn't match anything.

    The database and the tables inside it are set to UTF-8, as is the character encoding setting in WordPress. What else do I need to do to make sure that characters are being properly encoded in the database? I want to get this fixed before I have too much data in the blog (though I checked and the export file is properly encoded, so at least I'd be able to do that).

    Thanks,

    John

  2. jbiesnecker
    Member
    Posted 3 years ago #

    Nevermind, I just discovered the define('DB_CHARSET', 'utf8'); thing, and adding it to wp-config.php solved my problem. Why is this not the default setting??

  3. shlomof
    Member
    Posted 2 years ago #

    DO you happen to know what's the solution for an RSS feed in chinese that is displayed in gebrish.
    couldn't find a solution for this yet.
    thanks,
    Shlomo

Topic Closed

This topic has been closed to new replies.

About this Topic