ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Russian characters displaying as question marks

March 20, 2009 7:03pm

Subscribe [8]
  • #1 / Mar 20, 2009 7:03pm

    sabremarketing

    27 posts

    The Russian content looks fine in phpMyAdmin, but when it is pulled in to the front end, and also the EE control panel, the characters are displayed as question marks. The pages are all set to utf-8 like so…
    <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />

    I did have to alter the fields to utf8_unicode_ci instead of latin1_swedish_ci which was the default before. Is EE doing anything that would corrupt the characters before they are displayed, etc?

    Thanks,
    Gary

  • #2 / Mar 20, 2009 9:22pm

    Lisa Wess

    20502 posts

    Was this an import, Gary?  Or were these entered via the publish screen?

  • #3 / Mar 21, 2009 3:31am

    Ingmar

    29245 posts

    To answer your question, EE does not alter the characters, it displays them as it gets them from the db. UTF-8 is a good choice, in general, but it means that the content in your database needs to be in utf-8 as well. Tihs can be tricky, sometimes. Also, “latin1_swedisch_ci” only concerns the collation of your database, it is no problem to store utf-8 characters in there. In other words, no need to alter these fields.

    In closing, a link to the site in question would probably be quite helpful 😊

  • #4 / Mar 21, 2009 7:30am

    budulay

    6 posts

    try search in file ....../system/db/db.mysql.php:

    $this->server_info = @mysql_get_server_info();

    replace

    $this->server_info = @mysql_get_server_info();
    mysql_query("SET NAMES 'utf8'");
  • #5 / Mar 21, 2009 8:04am

    Ingmar

    29245 posts

    Please let me repeat: No hacks to EE are required to get Unicode aka utf-8 to display correctly. I have been doing it (with German characters) for ages.

  • #6 / Mar 21, 2009 3:55pm

    sabremarketing

    27 posts

    It was an import, not something entered thru EE. I changed the database collation because the characters weren’t being stored correctly in MySQL when I imported from a CSV, and changing it to utf-8 fixed that.

    I’ll PM you the URL on Monday when I can trouble shoot it.

    Thanks.

  • #7 / Mar 22, 2009 5:25am

    KeithW

    138 posts

    What version of MySQL are you using? This info. is displayed by phpMyAdmin.
    Also check what the *database* encoding is set to. Some hosting companies still set latin1 rather than utf-8
    as default database encoding, and don’t allow you to change this. In this case, all the tables in the database
    will also be latin1 by default unless you specify otherwise. Your post suggests that this is the case.
    (This may give you headaches when you migrate to a server with utf-8 default). 
    Also you are correct that, in phpMyAdmin, “utf8_unicode_ci” or “latin1_swedish_ci” does not mean
    just “collation” as shown on the screen, it means “character set = utf-8” and “collation = unicode_ci”
    or “character set = latin1” and “collation = swedish_ci”.
    The suggested hack (I haven’t tried it) presumably tells EE to treat the database as utf-8 by default
    even though the hosting company has set the default to latin1 and MySQL reports this to EE.

  • #8 / Mar 23, 2009 11:22am

    sabremarketing

    27 posts

    MySQL client version: 5.0.22
    MySQL charset:  UTF-8 Unicode (utf8)
    MySQL connection collation: utf8_unicode_ci

  • #9 / Mar 23, 2009 11:50am

    Steve Abraham

    149 posts

    If you check the page using the W3C validator, does it confirm that the page encoding is set to UTF-8?

    http://validator.w3.org/

    EDIT: The reason I ask is that I did some work for someone a while back where I wasn’t personally hosting the site, only to find that the server was overwriting all page encoding (regardless of what was set in the HTML).

  • #10 / Mar 23, 2009 6:09pm

    Ingmar

    29245 posts

    sabremarketing, I would like to take a step back here. Can you please show us a link to a site where it’s happening? It’s really impossible to troubleshoot otherwise.

  • #11 / Mar 23, 2009 6:20pm

    sabremarketing

    27 posts

    I just sent you another message, apparently the first one didn’t send.

    Gary

  • #12 / Mar 24, 2009 4:52am

    John Henry Donovan

    12339 posts

    Thanks for your email Gary. We are looking into it for you.

  • #13 / Mar 30, 2009 7:39pm

    sabremarketing

    27 posts

    Any progress? Let me know if I need to change anything in the DB, or re-import, etc.

    Thanks,
    Gary

  • #14 / Mar 30, 2009 8:42pm

    Greg Aker

    6022 posts

    Gary:

    I’m sorry for the delay.  How much Russian data did you import? 

    Kind Regards,

    -greg

  • #15 / Mar 31, 2009 2:53am

    John Henry Donovan

    12339 posts

    sabremarketing,

    Can you try the following wiki article.Note that these changes are made at your own risk as we do not support hacks. I don’t believe you need the htacces bit as your pages seem to be serving up the correct header.

    EE Wiki : Use UTF-8 with russian lang

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases