WordPress.org

Ready to get started?Download WordPress

Forums

WP2.2 by default doesn't establish proper UTF-8 connection to the db (5 posts)

  1. Guntis
    Member
    Posted 7 years ago #

    Just upgraded to 2.2 and discovered that all my blog shows question marks instead of Latvian letters. It turns out wp-settings.php file is missing 2 lines of code. After the line 264
    do_action('init');
    these 2 lines should be inserted:
    mysql_query("SET CHARACTER SET utf8");
    mysql_query("SET NAMES utf8");

    Could you please insert them in the original setup package file? MySQL 5 needs this to show proper UTF-8 encoding.

  2. MichaelH
    Member
    Posted 7 years ago #

    Would putting the new DB_CHARSET and DB_COLLATE definitions in wp-config.php work?

    See Editing wp-config.php

  3. Guntis
    Member
    Posted 7 years ago #

    SORRY!!! It's not wp-config.php file! It's wp-settings.php file.
    For me these two lines do the trick and Latvian letters appear properly. Could you please include these 2 lines there?

  4. lelion
    Member
    Posted 7 years ago #

    @Guntis:

    Did you try wp-config.php?

    Before I needed to edit wp-db.php to add SET NAMES and COLLATION there (UTF-8). I needed that to display correctly both in the blog and in the MySQL database cyrillic characters. Now I can do it via the wp-config.php file, which is a major relief:)

    Worst case: You can edit manually the wp-settings.php file?...

    Hope this helps:)

  5. jamespoling
    Member
    Posted 7 years ago #

    I believe I have tried al of these steps. I'm still having the problem as related here.

    http://wordpress.org/support/topic/120562?replies=2

Topic Closed

This topic has been closed to new replies.

About this Topic