Zen Cart Logo
Forums / General Questions / UTF8 some Japanese char are question marks ??

UTF8 some Japanese char are question marks ??

Views: 1,701

Results 1 to 7 of 7
16 Jan 2013, 9:28 PM
#1
studiotucker avatar

studiotucker

New Zenner

Join Date:
Sep 2008
Posts:
47
Plugin Contributions:
0

UTF8 some Japanese char are question marks ??

I am spinning over this one.... I have a Japanese language site with Japanese package by Crystal Koi installed several years ago on 1.3.8. Everything has worked fine until I upgraded to 1.5.1 and went live.:wacko:

Upload via ftp
PHP - 5.2.17
MySql - 5.0.96-community-log

It seems the Japanese language translations/php files are showing ok, but the database info is not fetching correctly and getting ?????.

All DB collation is correctly set at utf_gen_ci, english.php files in admin and includes are set to utf8, I've added the db_char_set.php file in extra configs, and set utf8 in the query_factory.php file.

The Japanese characters show in the db tables. When I change a menu item to Japanese in the catalog/products manager, it shows correctly.

I have thousands of products/descriptions and a large amount of customer, order and other info. I certainly don't want to go back and input manually.

I would appreciate any suggestions. (I do have a backup of 1.3.8 site and db).

16 Jan 2013, 9:33 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: UTF8 some Japanese char are question marks ??

studiotucker:

I've added the db_char_set.php file in extra configs, and set utf8 in the query_factory.php file.
Please explain EXACTLY what you did for both of these. What you wrote is generic, but your exact specifics are critical.
And there should be NO need to touch query_factory.php Again, exact details are needed.

16 Jan 2013, 10:27 PM
#3
studiotucker avatar

studiotucker

New Zenner

Join Date:
Sep 2008
Posts:
47
Plugin Contributions:
0

Re: UTF8 some Japanese char are question marks ??

A follow up....I have checked through the site and the problem seems to be only with the product catalog menu and item pages on the front end. Headers, define pages and such are showing fine......headers and menu in admin are fine, but the customer , order, catalog, and product data are not showing correctly...

16 Jan 2013, 10:39 PM
#4
studiotucker avatar

studiotucker

New Zenner

Join Date:
Sep 2008
Posts:
47
Plugin Contributions:
0

Re: UTF8 some Japanese char are question marks ??

You know, I think I just found the problem.....

I did put a new file (as I saw mentioned in other support threads) /extra configures/m_db_charset.php in both admin and includes.

Problem was I failed to put utf8 in the string....<?php define('DB_CHARSET', 'your_charset_here');....a senior lapse..... I thought I had, but when you replied I checked the file again and saw I had not changed it. Changed and now the JP is showing fine throughout the site........whew.:blush:

Thanks for the input about query_factory. I'll change back....time for a bottle of sake!

17 Jan 2013, 1:24 PM
#5
studiotucker avatar

studiotucker

New Zenner

Join Date:
Sep 2008
Posts:
47
Plugin Contributions:
0

Re: UTF8 some Japanese char are question marks ??

I have to say, I am surprised that I needed to add a separate file with one short line of code to get UTF8 to show correctly on all pages of the zencart platform. It's a pretty international platform and I don't understand why this can't be automatically included???

For anyone else who stumbles here looking for a solution, I followed a solution I found somewhere else and it worked.

Create a new .php file name it anything(?), I named mine "my_db_charset.php". Include in the file, one line of code <?php define('DB_CHARSET', 'utf8'); save and upload to your extra-configures directory in both includes and admin/includes.

I required utf8, but I would assume that you could use any charset that you need zencart to conform to and would just replace the utf8 in the line of code with yours.

17 Jan 2013, 6:32 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: UTF8 some Japanese char are question marks ??

studiotucker:

I have to say, I am surprised that I needed to add a separate file with one short line of code to get UTF8 to show correctly on all pages of the zencart platform. It's a pretty international platform and I don't understand why this can't be automatically included???
It IS automatically included. For new installations, not for upgrades.

When you do a new install of Zen Cart v1.5.0 or newer, the configure.php file will already contain a define for DB_CHARSET.
If your upgrade involved doing a new install of Zen Cart, then you would also have had that automatically. But, since you chose a different approach for upgrading, you've had to apply your own bandage to get to the same end result.

18 Jan 2013, 8:50 PM
#7
studiotucker avatar

studiotucker

New Zenner

Join Date:
Sep 2008
Posts:
47
Plugin Contributions:
0

Re: UTF8 some Japanese char are question marks ??

Thanks Doc.