Forums / Addon Language Packs / Changing to UTF-8 in existing cart?

Changing to UTF-8 in existing cart?

Locked

Started by arunachala on 9 Jun 2011, 5:32 PM · Views: 3,392

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
9 Jun 2011, 5:32 PM
#1
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Changing to UTF-8 in existing cart?

I have a bookstore with a few non-English titles. These titles display correctly in zen cart but when a customer orders them the order email has gibberish for non-English titles. A thread in the forum has a tutorial on how to change the encoding to UTF-8 from ISO_8859-1 to solve such problems. Can it be done without a new install of zen cart. It would save a lot of work if the changes can be done in the existing install. Any help? Suggestion? Thanks in advance.

11 Jun 2011, 4:21 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Changing to UTF-8 in existing cart?

In phpMyAdmin when you look at the structure of the products_name field in your products_description table, what collation is it set to?
Similarly, what is the collation of the customers_lastname field in your customers table?
In your english.php files, what is CHARSET defined to? What is CHARSET set to in any other languages you've got on your site?
What version of PHP?
What version of MySQL?

What is your usual backup procedure for your site?

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

11 Jun 2011, 12:44 PM
#3
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Re: Changing to UTF-8 in existing cart?

Our website keeps back up for 7 days. I downloaded the mysql database and the files. I went ahead and successfully changed the zen cart encoding to utf-8. The gibbersish in the email for non English characters is still there. I will find answer to the questions raised by you and get back to you.

11 Jun 2011, 3:55 PM
#4
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Changing to UTF-8 in existing cart?

I would be careful because translations from English to Gibberish, and even Klingon, are easy. But translation back from Klingon to English might be problematic...
(but I must admit am still an encoding noob..)

11 Jun 2011, 4:40 PM
#5
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Re: Changing to UTF-8 in existing cart?

DrByte Some of the questions raised by you opened my eyes to a host of incompatibility issues. Here is what I found.
In phpMyadmin when I looked at the structure of the produts_name filed, the collation was set to latin1_swedish_ci. I changed it to uft-8. Same with customers_lastname and I changed it to uft8_general_ci. In english.php I changed the CHARSET to uft8. No other language pack has been used by me in zen cart. php version was **4!!! **But I could change it to 5The full version is 5.2.17. mysql is version 5.0.:huh:

11 Jun 2011, 8:27 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: Changing to UTF-8 in existing cart?

I was asking questions, not giving instructions. I hope you keep copies of your backups. You may have damaged your database.

You should never change the collation settings directly, lest you lose characters aren't translated properly using that approach. There's a conversion script for changing the database collation/charset safely.
And in your English.php files charset should go to utf-8 not utf8.

What version of Zen Cart are you using?

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

11 Jun 2011, 9:55 PM
#7
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Re: Changing to UTF-8 in existing cart?

English.php file charset is utf-8 and was never utf8. I am using
Zen Cart 1.3.9f
Patch: 1::
Database Patch Level: 1.3.9a

Thanks for the warning. Is there any way to check if the database is damaged. Outwardly it looks OK.

12 Jun 2011, 3:17 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Changing to UTF-8 in existing cart?

Arunachala:

I am using
Zen Cart 1.3.9f
Patch: 1::
Database Patch Level: 1.3.9aYou should really be upgrading to v1.3.9h ... it's generally just a matter of updating a few files.

Arunachala:

Is there any way to check if the database is damaged. Outwardly it looks OK.
only by looking at products/categories/customer names/addresses, etc which have non-english characters in them that are dependent on utf8 for proper display. If you get funny symbols like square boxes or reverse-hearts etc showing in place of cyrillic symbols, for example, then that's an indicator that you've damaged the data.

Arunachala:

In phpMyadmin when I looked at the structure of the produts_name filed, the collation was set to latin1_swedish_ci.If that's what you found after running the conversion script you said you ran earlier, then ... your script did NOT actually do the job it should have done.
Arunachala:

I changed it to uft-8. Same with customers_lastname and I changed it to uft8_general_ci.
You should really be letting the script do that, and not doing it by hand, since doing it by hand will typically lose the special utf8-specific characters.

Arunachala:

php version was **4!!! **But I could change it to 5The full version is 5.2.17.

Arunachala:

I am using
Zen Cart 1.3.9f
You should be fine with PHP 5.2.17, and indeed that would be a better choice than PHP4. If you're running any other software on your website or any old addons that require PHP4, then you might need to upgrade those first before upgrading your PHP version. But ZC v1.3.9 is fine with PHP 5.2.3 and higher.

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

13 Jun 2011, 3:19 PM
#9
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Re: Changing to UTF-8 in existing cart?

DrByte I did most of the changes for collation based on the advice given below. Evidently those who have used it are OK with it.

CrystalKoi:

I posted a tutorial as to how to transition

zen-cart over to UTF-8 encoding also having the database encoded in UTF-8 too. This was made for carts using Japanese, but it could be used for many other languages.

Here is the link
UTF-8 Zen-Cart

I hope people find this helpful.

Regards,

CKD

I also found this add on UTF-8 Support for Zencart. It says changing on to UTF-8 on an existing cart is hard work and not for the faint-hearted . Has anybody used this add-on for fresh install.

13 Jun 2011, 5:49 PM
#10
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Re: Changing to UTF-8 in existing cart?

I have solved my problem by using English transliteration for non-English titles. This works fine.

Thanks for your advice.