Support » Fixing WordPress » WP2.2 by default doesn’t establish proper UTF-8 connection to the db

  • Guntis

    (@guntis)


    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • MichaelH

    (@michaelh)

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

    See Editing wp-config.php

    Guntis

    (@guntis)

    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?

    lelion

    (@lelion)

    @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:)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP2.2 by default doesn’t establish proper UTF-8 connection to the db’ is closed to new replies.