• I set WordPress to use UTF-8 charset and the content from database displays perfectly (not in phpMyAdmin, but it doesn’t matter) but all other content stored in *.php files (PageTemplates etc.) doesn’t inherit this property and displays bad characters. When I view the site’s source, there’s only one “charset=UTF-8”, not overridden by anything else.. The language I use is czech but UTF-8 shouldn’t have any problem with that.
    Website’s located at sco.hustej.net

    Thanks for any advice.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m having the same problem with Croatian language, but only recently since 2.2 ver.

    @cyberfly,
    are you sure youare saving those php files after editing with the correct encoding? You MUST use a plain text editor that saves the files with utf-8, otherwise the characters are messed up. Note: eve Notepad on XP has the feature to select the encoding!

    Moshu, I don’t think this has anything to do with the encoding when saving files in notepad or whatever, he is referring to the reading options in the control panel, set to UTF8. I am having huge problems with character encoding too, even though both WP and my database are UTF8, I’m stumped.

    My question is, what values should I enter for the database encoding and collation in WordPress 2.2 config.php?

    I thought 2.2 would solve this problem with the special database connection and collation options in config.php, but it has not worked for me — I wonder what is the right value, if you have the database and wordpress settings to UTF8, with the standard swedish_ci / Latin1 that comes with MySQL?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    No, moshu is correct.. WordPress doesn’t do some kind of magic character set translation. If your PHP files are not saved as UTF-8 text, then they won’t come out as UTF-8 text, no matter what your “settings” are.

    If the database content is working okay but the other stuff is not, then I’d look closely at the other stuff. It’s not a matter of the settings here.

    My question is, what values should I enter for the database encoding and collation in WordPress 2.2 config.php?

    UTF-8 across the board, of course. However, that’s not going to affect anything outside of the database options. If the database is working, but the theme is saved in some other charset, well…

    I was having the exact problem and yet i have found a sollution. Moshu was right: saving my code with UTF8 encoding really helped.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘UTF-8 not working for non-database content’ is closed to new replies.