Zen Cart Logo
Forums / Addon Language Packs / UTF-8 Zen-Cart Tutorial for v1.3.x

UTF-8 Zen-Cart Tutorial for v1.3.x

Views: 77,326

Results 61 to 80 of 145
25 Sep 2009, 6:33 AM
#61
spiritus avatar

spiritus

New Zenner

Join Date:
Apr 2009
Location:
Slovenia
Posts:
58
Plugin Contributions:
0

UTF-8 Zen-Cart Tutorial for v1.3.x

you're right.. old database is in latin1.. Because I've made site on test server and there I didn't need utf-8..
Now I use english and Slovenian language pack and I need utf-8 for that new site.
What can I do now? I have problem with collation, I must somehow change older database to utf-8 and than import it to new one.
Am I right?
Please help..
tnx for reply

25 Sep 2009, 7:12 AM
#62
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Converting them is not fun. I think someone did something like this, but off the top of my head, I can't remember.

You might be able to use easy populate module and pull all the data you need from one and put it in the other one. That would be easier I would think.

Good luck and just know that its always better to start with UTF-8.

Wish I had a better answer,

CKD

25 Sep 2009, 7:56 AM
#63
spiritus avatar

spiritus

New Zenner

Join Date:
Apr 2009
Location:
Slovenia
Posts:
58
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

I found one great thread. I think it will help to everyone with this problems..

Collation change for SQL databases

It works ..

24 Oct 2009, 5:52 PM
#65
nescaya avatar

nescaya

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Hello CrystalKoi
Thanks so much for your utf-8 files and tutorial. I have my shop set up and all works fine except for one small problem. When checking out in IE8 in Japanese, the checkout_payment page is not using the CSS stylesheet and is coming out in v large type. All other checkout pages display correctly. All pages display correctly in Firefox. Originally I thought it was because I was using Worldpay pages in English, but disabling Worldpay did not help.
I did look at the source and the page is calling for the correct stylesheet.
Also if I enable Paypal website payments, both the checkout_payment and payment_confirmation pages display wrongly when the customer chooses Paypal. Please, can you suggest where the problem may be arising.
Thanks

15 Jan 2010, 8:25 AM
#66
adg avatar

adg

New Zenner

Join Date:
Jan 2010
Posts:
10
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

I've followed the instructions on CrystalKoi's site, for my JustHost.com ZenCart installation (it's ZenCart 1.3.8a [patched]). The DB seems set for uft8_general_ci collation beforehand, and then I update the english.php and query_factory.php pages as described in the UTF-8 Zen-Cart tutorial. After this, FireFox does display the page as utf-8.

I then proceeded with the Zen-Cart 1.3.8 Japanese Pack Install tutorial, but the Japanese language site goes to a blank page when I click the 'add to cart' button. The product gets added to the cart, but the redirect doesn't bring back a page (it's just blank). In english, this works just fine.

Is there something I can do to find out what's the problem?

I've done the tutorials twice now, each time with a fresh install, so I'm confident that I'm performing the steps OK. I do have a template that I'm using (apple_zen).

I've tried using the debug_log utility, but it doesn't place any log files in the /cache/ directory. Also, I've tried replacing the query_factory.php file from earlier in this thread, but it didn't do anything for me.

Thanks,

Alex

15 Jan 2010, 7:48 PM
#67
adg avatar

adg

New Zenner

Join Date:
Jan 2010
Posts:
10
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Yaay, I figured this out.

I must have not refreshed the /cache directory yesterday, because this morning it was filled with log files. Using those, I tracked down two problems.

1st. The /includes/languages/japanese.php file had extra spaces and a carriage return after the closing ?>

2nd. That file was not saved as UTF-8 without BOM. It was simply UTF-8. Using Notepad++ you have the option of saving without BOM (Byte Order Mark).

This page explains the issue:
https://www.zen-cart.com/tutorials/index.php?article=396

So, long story short, the answers were all here in my case, I just didn't know what questions to ask (because I didn't check the logs).

16 Mar 2010, 2:09 PM
#68
asdesign avatar

asdesign

Zen Follower

Join Date:
Jun 2009
Location:
Israel
Posts:
152
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Sorry to bump this off but I'm having a problem. My "product was added on date" displays in gibbrish. I'm using hebrew. Which file do I have to convert to UTF8 to make it work properly? Or is it SQL related? I fresh installed Zencart with UTF-8 support already built in.

Asdesign.co.il - Extreme Sports Blog

16 Mar 2010, 2:17 PM
#69
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Is your language file settings, example: english.php, is this set to utf-8 in the settings, not the file itself, which should also be utf-8, but what sets the source code to utf-8.

16 Mar 2010, 2:25 PM
#70
asdesign avatar

asdesign

Zen Follower

Join Date:
Jun 2009
Location:
Israel
Posts:
152
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

I saved my hebrew.php in dreamweaver with UTF-8 encoding (w/o bom of course) and inside the file it has utf-8 defined properly.

// charset for web pages and emails
define('CHARSET', 'utf-8');

Thing is, I don't know what generates the days and dates on Zen Cart...

This is the template I'm working on (hope you're using firefox):

http://www.hilapc.co.il/index.php?main_page=product_info&products_id=5

If you can see the characters properly (I mean, the hebrew stuff) then, you'll notice the culprit down below on the product info page, it's the last line in the middle box.

Asdesign.co.il - Extreme Sports Blog

16 Mar 2010, 2:34 PM
#71
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

does this text look right?
ЧћЧ•Ч¦ЧЁ Ч–Ч” Ч”ЧЄЧ•Ч•ЧЎЧЈ Ч‘Ч™Ч•Чќ щбъ, 13 Ч‘ошх, 2010

16 Mar 2010, 2:37 PM
#72
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

If that is right, just do a search of the files with dreamweaver for part of that language, shouldn't be too hard to track down. Give it a go!

16 Mar 2010, 2:44 PM
#73
asdesign avatar

asdesign

Zen Follower

Join Date:
Jun 2009
Location:
Israel
Posts:
152
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

I use Total Commander since it can track down text strings within files. Thing is, I did a simple test. In the english version you'd expect the days to be "sunday, monday" etc'. So I looked for "sunday" and it didn't catch anything, meaning ZC somehow generates this on the fly.

Asdesign.co.il - Extreme Sports Blog

16 Mar 2010, 2:52 PM
#74
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

No, I don't think this is true, as it would not generate Hebrew on the fly. You need to do a search for a part of the hebrew with whatever file search tool you have. Once you find the file, you need to change the encoding of that file. Good luck

16 Mar 2010, 3:22 PM
#75
asdesign avatar

asdesign

Zen Follower

Join Date:
Jun 2009
Location:
Israel
Posts:
152
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Hmm, I checked my SQL database and few tables have "latin1_swedish_ci" in the collation column instead of utf8, does that pose any problem?

Asdesign.co.il - Extreme Sports Blog

16 Mar 2010, 5:27 PM
#76
drbyte avatar

drbyte

Sensei

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

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

I suspect your DATE_FORMAT_LONG definition is wrong, or your server is not generating the date "words" properly when the strftime() function is called. You may have to resolve the matter with your hosting company by confirming that they've got a valid hebrew language config set in their PHP.
NOTE: All the date "words" are generated by the PHP configuration on your server. Zen Cart DOES NOT spell out all the days of the week and months of the year in a language file.

files involved in english to display the "date added" content:
/includes/languages/english/YOUR_TEMPLATE/product_info.php (and other product types too):

define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');

/includes/languages/YOUR_TEMPLATE/english.php:

  define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

/includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php (and other product types too):

      <p id="productDateAdded" class="productGeneral centeredContent"><?php echo sprintf(TEXT_DATE_ADDED, zen_date_long($products_date_added)); ?></p>

/includes/functions/functions_general.php in the zen_date_long() function:

    return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));

.
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.

16 Mar 2010, 5:32 PM
#77
asdesign avatar

asdesign

Zen Follower

Join Date:
Jun 2009
Location:
Israel
Posts:
152
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Hmm, I've already converted these files to UTF-8 :) But...I think I may have found the problem. I didn't convert the admin hebrew language (it's basically the old english language files) files so I get this error in the admin aswell. I'm going to convert them and then check again, hoping this will resolve the problem. The server settings should be good. If this doesn't work I'll check deeper into it. Thanks a lot Dr.Byte, I'm afraid this forum is huge so I posted in few places to make sure it gets attention. Didn't mean to upset anyone.

Asdesign.co.il - Extreme Sports Blog

16 Mar 2010, 6:25 PM
#78
asdesign avatar

asdesign

Zen Follower

Join Date:
Jun 2009
Location:
Israel
Posts:
152
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

Hmm...I noticed that if I change the encoding back to windows-1255 on the browser it displays fine. Hmmm..................this doesn't relate to the SQL anywayn, does it?

Asdesign.co.il - Extreme Sports Blog

16 Mar 2010, 6:28 PM
#79
drbyte avatar

drbyte

Sensei

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

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

No connection to SQL.
I suspect maybe the server's language file may not be properly encoded?
Just a guess

.
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.

16 Mar 2010, 6:31 PM
#80
asdesign avatar

asdesign

Zen Follower

Join Date:
Jun 2009
Location:
Israel
Posts:
152
Plugin Contributions:
0

Re: UTF-8 Zen-Cart Tutorial for v1.3.x

I understand. How is that file named? php.ini perhaps? I'm also wondering, if another cart is installed on the server and uses charset windows-1255, will it be badly affected from changing the encoding of the server language file?

Asdesign.co.il - Extreme Sports Blog