Support » Fixing WordPress » Wrong encording/charset?

  • Resolved SkrivarSidan

    (@skrivarsidan)


    Hey all!

    I’ve just changed hosting company and experienced problems with Swedish characters in my wordpress blog. In config.php I have:

    define ( ‘DB_CHARSET’, ‘utf8’);
    define ( ‘DB_COLLATE’, ”)

    and in the database:

    Collation MySQL connection Documentation: ute8_general_ci

    When I try and write a new post is the Swedish letters right but everything else is wrong coding.

    My question is how to change the database so it will be correct Swedish characters?

    Grateful for any help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Max

    (@clementsm)

    I would probably make sure that the DB collation/Charset is actually also in UTF8, then you should not have problems. You should and see what collation/charset the tables in your database currently have – it sounds like they may not be in UTF8?

    To convert your database default char-set and collation to UTF8 you should execute this query:

    ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    You should replace the word “databasename” with your actual database name.

    This only changes the database default for future tables added to the database. You also need to convert every table in the database using the following query:

    ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    Needless to say, you need to make a backup before you do any of this to your database.

    At this point everything in your database should be converted to UTF8 as well, and things should start to be interpreted correctly.

    Thread Starter SkrivarSidan

    (@skrivarsidan)

    Thanks! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrong encording/charset?’ is closed to new replies.