• Hi,
    I’m using pretty current software on my developing workstation
    PHP 5.0.2 and MySQL 4.1.7 and apache 2.0.52 and was having big difficulties entering non ascii chars into post and pages. Basically the post would get cut off at the non ascii char. The thing that got me was that phpMyAdmin was working fine. After much searching and frustration. I found out that the browser was delivering the wp content in non utf-8 where as the it was delivering the phpmyadmin content in utf-8. The whole thing basically boils down to this fix.
    In wp-settings.php after the line:
    require_once (ABSPATH . WPINC . '/wp-l10n.php');
    add this code:

    // Make sure we set the MySQL character set to the same character set the blog uses
    $wpdb->query("SET CHARACTER SET " . get_settings('blog_charset') . ";");
    // Make sure we tell the browser which charset to use otherwise we get problems with non ascii chaaracters
    // and mysql
    header('Content-Type: text/html; charset=' . get_settings('blog_charset'));

    It sets the mysql character set to the blog character set and
    also send a header which seems to tell the browser in which
    character set to send the return content.
    This fix is tested in firefox 1.0 and ie6 under XP SP2.
    Regards
    Adi

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘problems with non ascii chars in 1.3’ is closed to new replies.