Forums / General Questions / gibberish at homepage in Chinese

gibberish at homepage in Chinese

Views: 3,747

Results 1 to 15 of 15
15 Sep 2015, 6:49 AM
#1
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

gibberish at homepage in Chinese

Could anyone help me,please?

Zencart v1.5.4 and installed chinese patch simplified utf8. I've imported v1.5.1 data and changed all web file Simplified Chinese text to traditional Chinese.

But I found there is gibberish at the homepage

i.e. New Product For "???"
Attachment 15605

and

Monthly Specials For "???"
Attachment 15606

I've changed all collation to utf8_generic_ci from default latin1_swedish_ci
Attachment 15607

And when installing v1.5.4, is it possible to change the default collation to utf8_generic_ci instead of latin1_swedish_ci? I cannot change it even I choose to default utf8 when installing.

Thank you very much in advance!

15 Sep 2015, 6:57 AM
#2
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: gibberish at homepage in Chinese

I've imported v1.5.1 data and changed all web file Simplified Chinese text to traditional Chinese.

What do you mean by that?

15 Sep 2015, 7:57 AM
#3
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

Re: gibberish at homepage in Chinese

Some of their characters are different. In my city, people use Traditional Chinese, so I have to change all Simplified Chinese characters to Traditional.

15 Sep 2015, 11:49 AM
#4
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: gibberish at homepage in Chinese

Are these ???? supposed to be month names?

15 Sep 2015, 12:03 PM
#5
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

Re: gibberish at homepage in Chinese

Thannaree:

Are these ???? supposed to be month names?

Yes.
In English patch, it should be "New Products For September & "Monthly Specials For September". But the month name cannot be decoded properly in Chinese patch!

16 Sep 2015, 2:37 AM
#6
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: gibberish at homepage in Chinese

In files includes/languages/schinese.php and admin/includes/languages/schinese.php

$locales = array('zh_CN', 'zh_CN.utf8', 'zh');

Could you try adding locales for traditional?

I am pulling these from Google:
Hong Kong: 'zh_HK', 'zh_HK.utf8',
Traditional: 'zh_HANT', 'zh_HANT.utf8',
Taiwan: 'zh_TW', 'zh_TW.utf8',

16 Sep 2015, 4:51 AM
#7
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

Re: gibberish at homepage in Chinese

Thannaree:

In files includes/languages/schinese.php and admin/includes/languages/schinese.php

Could you try adding locales for traditional?

I am pulling these from Google:
Hong Kong: 'zh_HK', 'zh_HK.utf8',
Traditional: 'zh_HANT', 'zh_HANT.utf8',
Taiwan: 'zh_TW', 'zh_TW.utf8',

Thank you Thannaree! I'm in Hong Kong so I guess I should use zh_HK.

Here is the original code:

$locales = array('zh_CN', 'zh_CN.utf8', 'zh');
  @setlocale(LC_TIME, $locales);

I changed to :

$locales = array('zh_HK', 'zh_HK.utf8', 'zh');
  @setlocale(LC_TIME, $locales);

The gibberish still exists.

I'm not familiar with programming. I tried to remove the definition of $locales, i.e.

$locales = array('zh_HK', 'zh_HK.utf8', 'zh');
  @setlocale(LC_TIME,  'zh_HK.utf8');

The month gibberish problem seems solved!
Homepage
Attachment 15611

Admin page
Attachment 15612

But I wonder it will drive other problems in somewhere, won't it?

Could you please also telling me whether I have to change all table collations to utf8_generic_ci in database?

Thank you!

16 Sep 2015, 11:17 AM
#8
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: gibberish at homepage in Chinese

I changed to :
Code:
$locales = array('zh_HK', 'zh_HK.utf8', 'zh');
@setlocale(LC_TIME, $locales);
The gibberish still exists.

Have you also tried with

$locales = array('zh_HANT', 'zh_HANT.utf8', 'zh');
@setlocale(LC_TIME, $locales);
16 Sep 2015, 11:40 AM
#9
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: gibberish at homepage in Chinese

And when installing v1.5.4, is it possible to change the default collation to utf8_generic_ci instead of latin1_swedish_ci? I cannot change it even I choose to default utf8 when installing.

How did you install it? I just did a fresh v1.54 install manually and UTF-8 is set by default in the drop down. And after installation collation is utf8_generic_ci.

16 Sep 2015, 12:07 PM
#10
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

Re: gibberish at homepage in Chinese

Thannaree:

Have you also tried with

$locales = array('zh_HANT', 'zh_HANT.utf8', 'zh');
@setlocale(LC_TIME, $locales);


I've tried it and TW and HANS but the month "September" displayed in English instead of Chinese. 

Could you give me advise if changing like this should be okay?

@setlocale(LC_TIME, 'zh_HK.utf8');

16 Sep 2015, 12:29 PM
#11
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

Re: gibberish at homepage in Chinese

Thannaree:

How did you install it? I just did a fresh v1.54 install manually and UTF-8 is set by default in the drop down. And after installation collation is utf8_generic_ci.

Thank you Thannaree for your great help!

I deleted the whole test site folder and tried to install it again.

I chose ULT8 (default) and then install it.
Attachment 15613

But all collations are latin1_swedish_ci.
Attachment 15614

Actually, is it workable if I keep all collations to be latin1_swedish_ci (I will have to install Chinese patch zencart)? If not, could you teach me how I can switch them to utf8_generic_ci in one time instead of revising them one by one? Thank you so much!

18 Sep 2015, 4:09 AM
#12
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: gibberish at homepage in Chinese

Regarding locales I guess that $locales should be using: $locales = array('zh_HK', 'zh_HK.utf8', 'zh'); and that therefore you should not have to change (LC_TIME, $locales). Just in case, have you well refreshed the page after trying with that?

$locales = array('zh_HK', 'zh_HK.utf8', 'zh');
@setlocale(LC_TIME, $locales);

To change collation in your database:
Log into phpMyAdmin in your cpanel.
Select your database from the list on the left.
Click on "Operations" from the set of tabs at the top.
In the Collation box, select utf8_general_ci from the dropdown menu.
Click Go.

Perhaps you should contact your hosting admin and ask them what locales they use.

18 Sep 2015, 3:46 PM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: gibberish at homepage in Chinese

There is also a database conversion utility to do something similar to this:
Convert db2utf8

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

20 Sep 2015, 4:45 AM
#14
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

Re: gibberish at homepage in Chinese

Thank you Thannaree! All problems are solved.

20 Sep 2015, 4:48 AM
#15
jay2015 avatar

jay2015

New Zenner

Join Date:
Sep 2015
Location:
Hong Kong
Posts:
45
Plugin Contributions:
0

Re: gibberish at homepage in Chinese

mc12345678:

There is also a database conversion utility to do something similar to this:
Convert db2utf8

This is a very powerful program! All collations changed to UTF8 in few seconds, Thank you!