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.

UTF -8 and Latin characters display

March 16, 2009 11:18am

Subscribe [3]
  • #1 / Mar 16, 2009 11:18am

    tsoares

    114 posts

    Hi,

    The Latin characters ’,–, ”, “, ”  getting displayed on the site suddenly. We have not changed any DB settings or server settings.


    I followed most of the advice mentioned here:
    http://expressionengine.com/wiki/Switching_EE_to_Use_UTF-8_Charset/
    and hacked db.mysql.php, but it didn’t solve the problem.


    The System Variable are the following:

    character_set_client   latin1
    character_set_connection   latin1
    character_set_database   latin1
    character_set_filesystem   binary
    character_set_results   latin1
    character_set_server   utf8
    character_set_system   utf8
    character_sets_dir   /usr/share/mysql/charsets/
    collation_connection   latin1_swedish_ci
    collation_database   latin1_swedish_ci
    collation_server   utf8_general_ci

    $this->query("SET CHARACTER SET utf8");
            $this->query("SET COLLATION_CONNECTION=utf8_general_ci");

    We need to fix this issue soon

    Also temporary fix I replaced the latin characters with correct ones.

    Pls suggest what else could fix the issue.

    Thanks,

  • #2 / Mar 16, 2009 11:22am

    Sue Crocker

    26054 posts

    tsoares, do you have a link to the site in question?

  • #3 / Mar 16, 2009 1:12pm

    tsoares

    114 posts

    The site is:

    http://blogs.cisco.com/news/comments/the_100_billion_collaboration_stimulus_plan_of_2009_part_1/

    For example:
    “Can you come to a meeting right now.” 
“No, it’s almost lunch time. If I miss lunch my day will be 12 hours of uninterrupted misery


    The DB has the correct characters and correct characters are showing on the blogs cp panel also. It is not showing correctly on the website.

    I like said, I followed all the step in the above links.

    Also Admin mentioned below:

    mysql> show create table blogs_exp.exp_weblog_data\G
    *************************** 1. row ***************************
        Table: exp_weblog_data
    Create Table: CREATE TABLE `exp_weblog_data` (
      `entry_id` int(10) unsigned NOT NULL default ‘0’,
      `site_id` int(4) unsigned NOT NULL default ‘1’,
      `weblog_id` int(4) unsigned NOT NULL default ‘0’,
      `field_id_2` text NOT NULL,
      `field_ft_2` tinytext,
      `field_id_3` text NOT NULL,
      `field_ft_3` tinytext,
      `field_id_5` text NOT NULL,
      `field_ft_5` tinytext,
      `field_id_6` text NOT NULL,
      `field_ft_6` tinytext,
      KEY `entry_id` (`entry_id`),
      KEY `weblog_id` (`weblog_id`),
      KEY `site_id` (`site_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1

    and content is in UTF-8


    Thanks,

  • #4 / Mar 16, 2009 4:09pm

    Ingmar

    29245 posts

    No hacking should be required. What you are seeing are utf-8 encoded characters displyxed as iso-8859-1. Now,  you do have

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    in your site, and that should be all that’s needed. As a quick test, I saved the source to a local file and viewed that in a brwoser; it worked as intended (and changing the encoding to iso-8859-1 produced the results you are seeing on the live site.)

    Somehow your characters are still shown in Latin-1 instead of Unicode. Did something on your server change recently? Might be a default charset, I’ve seen it before.

  • #5 / Mar 16, 2009 5:33pm

    tsoares

    114 posts

    Thanks, I am checking with Admins for any thing changed on the server side.

    I am not seeing the latin characters in the control panel post content. Pls let me know what else I could check.

    Thanks

  • #6 / Mar 16, 2009 5:39pm

    Ingmar

    29245 posts

    I am not sure about your setup, so talking to your admins is a good idea. I can just tell the (familiar) symptoms I see: utf-8 chars displayed as iso-8859-1. Let us know how it goes.

  • #7 / Mar 16, 2009 5:53pm

    tsoares

    114 posts

    Also I noticed that if blogger copies the filed quotes from the MS word. Will that cause any issue.

    Thanks

  • #8 / Mar 16, 2009 5:55pm

    Ingmar

    29245 posts

    Word’s fancy quotes can be an issue, but shouldn’t if the characters are encoded correctly.

  • #9 / Mar 16, 2009 8:20pm

    tsoares

    114 posts

    Hi Ingmar,

    Automatically Convert High ASCII Text to Entities setting to YES and Updating posts with issues fixed the issue.

    Pls tell me if there is any easy plugin for just click the update button on the post.

    Thanks

  • #10 / Mar 16, 2009 8:50pm

    Greg Aker

    6022 posts

    tsoares:

    As long as you are converting the High ASCII Text to entities as you seem to be doing now, that should do the trick.

    However, any old posts will need to be updated for the conversion to go through.

    -greg

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

ExpressionEngine News!

#eecms, #events, #releases