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.

Japanese Encoding problems

August 25, 2010 11:27pm

Subscribe [5]
  • #16 / Aug 31, 2010 4:27am

    John Henry Donovan

    12339 posts

    jsks16,

    What SQL Manager are you using?
    Something like phpMyAdmin?

    If you look in the exp_weblog_data table are the characters appearing correctly in the database?

    This includes control panel along with the pages.

    Can you confirm if you are using a Japanese language pack to translate the Control Panel?
    What specifically is not showing correctly in the control panel. Do you have a screenshot you could attach please?

    I found a link here where you can try a few different htaccess which will override your mbstring settings

    Let us know if one of them works for you

  • #17 / Sep 01, 2010 12:35am

    jsks16

    31 posts

    jsks16,

    What SQL Manager are you using?
    Something like phpMyAdmin?

    If you look in the exp_weblog_data table are the characters appearing correctly in the database?

    This includes control panel along with the pages.

    Can you confirm if you are using a Japanese language pack to translate the Control Panel?
    What specifically is not showing correctly in the control panel. Do you have a screenshot you could attach please?

    I found a link here where you can try a few different htaccess which will override your mbstring settings

    Let us know if one of them works for you

    Thanks for the reply

    well it seems I got the encoding to work for the japanese language pack in EE, but all the japanese data in the database seems to have not encoded correctly.

    here is the screenshot

    as for a mysql admin, my companies web server has no control panel and no access to phpMyAdmin.  I had to do import the database via ssh. 

    but now the problem seems to be with the data in the database not encoding correctly :/

  • #18 / Sep 01, 2010 12:51am

    jsks16

    31 posts

    jsks16,

    What SQL Manager are you using?
    Something like phpMyAdmin?

    If you look in the exp_weblog_data table are the characters appearing correctly in the database?

    This includes control panel along with the pages.

    Can you confirm if you are using a Japanese language pack to translate the Control Panel?
    What specifically is not showing correctly in the control panel. Do you have a screenshot you could attach please?

    I found a link here where you can try a few different htaccess which will override your mbstring settings

    Let us know if one of them works for you

    Oh I am exporting my database from my local machine via phpMyAdmin and importing it to my companies server via ssh.

  • #19 / Sep 01, 2010 10:48am

    Ingmar

    29245 posts

    The screenshot you showed means an encoding issue, utf-8 encoded data is shown with a different encoding. When you create a new entry, or edit an existing field and re-save, does it show correctly?

  • #20 / Sep 01, 2010 10:56am

    jsks16

    31 posts

    The screenshot you showed means an encoding issue, utf-8 encoded data is shown with a different encoding. When you create a new entry, or edit an existing field and re-save, does it show correctly?

    no it doesn’t encode correctly when I try to fix it, all I get is”?????????????”

  • #21 / Sep 01, 2010 4:59pm

    Brandon Jones

    5500 posts

    jsks16,

    The characters appear correctly in your exported SQL file, correct? If so, the problem is going to be on the importing side of things. Instead of using the shell, can you perhaps install phpMyAdmin on your company’s server and try the import with it?

    It’s possible there will still be an encoding issue even then, which would point to a server configuration issue, but it’d be worth a try.

  • #22 / Sep 01, 2010 8:10pm

    jsks16

    31 posts

    jsks16,

    The characters appear correctly in your exported SQL file, correct? If so, the problem is going to be on the importing side of things. Instead of using the shell, can you perhaps install phpMyAdmin on your company’s server and try the import with it?

    It’s possible there will still be an encoding issue even then, which would point to a server configuration issue, but it’d be worth a try.

    Ok I will try, but chances are my company’s host will tell me they can’t give me access to phpMyAdmin.  They don’t even have a control panal for me to access.  If it is a server configuration issue, is there any way to find out the configuration of the sever and where the problem might be? 


    I have their php info here.  I don’t know if this helps but it might

    [Mod edit: Removed sensitive link]

  • #23 / Sep 01, 2010 8:26pm

    Brandon Jones

    5500 posts

    Hi jsks16,

    phpMyAdmin is Free software that you could install on the server. Taking a look at your phpinfo() though, particularly the mbstring section, there are discrepancies between the master and local values (local being what is actually in effect).

    Can you compare those local values to the local values on your working (“local”) server?

  • #24 / Sep 01, 2010 10:47pm

    jsks16

    31 posts

    Hi jsks16,

    phpMyAdmin is Free software that you could install on the server. Taking a look at your phpinfo() though, particularly the mbstring section, there are discrepancies between the master and local values (local being what is actually in effect).

    Can you compare those local values to the local values on your working (“local”) server?


    Hi Brandon

    thanks for the reply.  I installed phpMyAdmin on the server and tried to re-import the database.  I got this error

    Error
    There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

    ERROR: Unclosed quote @ 118
    STR: ‘
    SQL:
    INSERT INTO `exp_categories` VALUES(63, 1, 3, 0, ‘Ordering ‘, ‘ordering’, ‘注文する方法などのお知らせ’, ‘

    SQL query:

    INSERT INTO `exp_categories` VALUES(63, 1, 3, 0, ‘Ordering ‘, ‘ordering’, ‘注文する方法などのお知らせ’, ‘

    MySQL said:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1


    Also, yes, I noticed the mbstring values were all over the place.  I listed them on message #12 of this string.    Do you think that might be the problem?

  • #25 / Sep 02, 2010 2:35am

    jsks16

    31 posts

    ok I have more information which MAY be the root of this problem, but I need to confirm it with you.

    here are the mysql character sets for my working server


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


    Here are the mysql character sets for my computer, where i developed the site and put all the information in

    character_set_client   latin1
    character_set_connection   latin1
    character_set_database   latin1
    character_set_filesystem   binary
    character_set_results   latin1
    character_set_server   latin1
    character_set_system   utf8
    character_sets_dir   /Applications/MAMP/Library/share/mysql/charsets/
    collation_connection   latin1_swedish_ci
    collation_database   latin1_swedish_ci
    collation_server   latin1_swedish_ci


    and here are the character sets for my company’s host

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


    There are a lot of things set to latin1 on the two working servers, and everything is basically utf8 on the non-working server.  Do you think this the root of the problem?

  • #26 / Sep 02, 2010 3:55am

    jsks16

    31 posts

    Ok, after many exchanges with the my company’s host we think the problem IS the latin1/utf8 discriprency. 

    I have tried to convert the database using iconv via ssh, but the data was converted to even more junk
    (see here )

    I dont know if i could possibly convert every table and ever column in the DB because it is just to big.


    do you know how I can get the database converted correctly???
    I am slightly curious as to why the japanese appears fine in the latin1…

    thanks for all your help

  • #27 / Sep 02, 2010 2:05pm

    Brandon Jones

    5500 posts

    Hi jsks16,

    Ideally conversion to UTF-8 would be preferable, but for now it sounds like the best approach is to minimize or totally eliminate the conversion steps. Your company’s host should be able to get their database encoding settings to match yours. If they’re both latin1 you shouldn’t have any problems or any need for conversion.

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

ExpressionEngine News!

#eecms, #events, #releases