If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading Your Zen Cart / Upgrading to 1.5.x / Chinese Language from Database Garbled after upgrading from v137

Chinese Language from Database Garbled after upgrading from v137

Started by haostaff on 20 May 2015, 5:38 PM · Views: 1,701

Results 1 to 3 of 3
20 May 2015, 5:38 PM
#1
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Post #1 by haostaff

Managed the upgrade, except the Chinese texts (category titles, products titles, descriptions, etc.) from the database are garbled.

Leave link to Chinese pages here: http://haostaff.com/store/index.php?main_page=products_new It is fine if toggled to English.

Worked for hours and hours without result. Some expert pointers are much appreciated! I hope I can re-install / upgrade it the right way.

Exported database using phpMyAdmin. Old database characters were Latin1_Swedish. languages/chinese.php has always been "define('CHARSET', 'GB2312');".

Imported the database, using "UTF8" default. Ran the zc_install for database upgrade.

Spent hours trying to change, or re-import the database in difference characters and collates. No luck.

Noticed the 1.5.4 admin/includes/configure.php and includes/configure.php files have "UTF8" set as database character.

Don't know how to make sense of all of these. Thanks in advance for any help!

Jeff

20 May 2015, 6:41 PM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

I suggest running this utility: https://www.zen-cart.com/downloads.php?do=file&id=1318

Try letting it just convert to utf8.
If that's still not sufficient then try altering it to use the correct collation for GB2312 equivalent.

You'll need to set the proper CHARSET in your own language files, or set CHARSET to utf8 to match.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 May 2015, 3:01 AM
#3
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Post #3 by haostaff

Thank you, DrByte, as ever.

I did run that utility, but only blindly and did not follow through with other moves as I did not know what I was doing at all.

Now it's all fixed! What I did not try before was amending the admin/includes/configure.php and includes/configure.php files

define('DB_CHARSET', 'utf8_general_ci'); (from previously 'utf' only)

Did not have to change my Chinese language files, they are still

define('CHARSET', 'GB2312');

That did it for me. Once again, thanks!