Support » Fixing WordPress » Endless UTF-8 character trouble

  • Is there any definitive guide to solve encoding/character set problems with WordPress? I have a couple of dozen sites and many of them have the same problems. For example characters display fine on the site but are messed up in the database. For example the character é is displayed in the db as é. Also if I do an export of the db the characters are messed up the same way.

    I have read every single forum thread about this. The codex pages are quite confusing as well, even for me as a webdesigner/developer.
    These codex pages are unclear and contain all kinds of warnings (rightly so)

    In the forum threads there are some plugins mentioned, but I’ve read enough bad experiences about them not to try them yet. And most of them are outdated (wp 2.1). The problem is also that even if you use something like phpMyAdmin, looking at the db tables you never know what you’re looking at. There’s all kinds of layers/steps in getting the “raw” data out of the db onto your screen, at each step some wrong conversion can take place, etc.

    I just want to know a few things:
    1) what character encodings do I have for REAL in my databases?
    2) if not in UTF-8, what to do to get it that way?

Viewing 1 replies (of 1 total)
  • So another WordPress website. Again character encoding problems. This time an older install, wp 2.6.

    1- Characters display fine on website, sent headers are utf-8, meta content-type is also utf-8.
    2- Characters display fine in backupped .sql file (made by backup plugin) when I open them in my texteditor
    3- However, the sql dump says table fields are latin1_general_ci and db tables are CHARSET=latin1
    3- Create local db in phpMyAdmin
    4- Import backup sql file

    And then, suddenly characters display wrong. ë displays as �
    After adding
    define(‘DB_CHARSET’, ‘utf8’); // force utf8
    define(‘DB_COLLATE’, ‘utf8_general_ci’); // force collation
    to the local wp-config file, characters display fine again?

    What is happening here?

    a) Are the original characters in the live website latin or UTF-8?
    b) Is it the fault of the db backup plugin that the fields and tables are written as latin instead of utf-8?
    c) Is it a problem of my local phpmyadmin install?

Viewing 1 replies (of 1 total)
  • The topic ‘Endless UTF-8 character trouble’ is closed to new replies.