Japanese stopped displaying in cart, still displays in Admin
Using 1.39 upgraded from 1.38 with the Japanese language pack elements from Crystal. Worked in 1.38, worked in 1.39.
Added a 2nd store to the same database with different prepended string. 2nd store installed & worked with demo products. When I added the Japanese elements, for some reason the database collation didn't save as utf8_general_ci for the tables.
So ran a process that updates all tables to utf8_general_ci. It appeared to work.
But all of the Japanese no longer displays on the first site. However, it displays and edits properly on the admin for that site.
The html headers generated include:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
... and the browsers correctly select utf-8 encoding, but the output is mangled.
I'd assume my database data was mangled, but as I mentioned, it displays and edits perfectly in Admin.
So I looked for differences between the japanese.php folder in the Admin section and the one in the main includes folder.
The one in th Admin section has a header that says it's
* @version $Id: english.php 7440 2007-11-17 21:51:35Z drbyte $
The one in the main cart includes folder is the one from Shawn Ward and Seiji Matsumoto
* @version $Id: japanese.php v1.2 CKD crystalkoi.com Shaun Ward/Seiji Matsumoto
Any suggestions would be GREATLY appreciated at this point. Thanks.
Re: Japanese stopped displaying in cart, still displays in Admin
yes i am also facing the same problem so any third person could solve our problem there?
Re: Japanese stopped displaying in cart, still displays in Admin
Updates:
1) the conversion also affected another MySQL program using the same database. Its fields were already labeled utf8_general_ci so I didn't expect them to be affected, but the tech support people said the data had been corrupted, and they fixed it...
2) I found that I could copy the readable Japanese characters from my Admin area (for example, a product description) and paste them directly into the PHPMyAdmin fields... and it would fix them on the website!
3) Once they looked good on the website and good in PHPMyAdmin, they became unreadable in ZenCart Admin. No kidding. So some difference in encoding between the Admin page and the MySQL database is going on, with the amazing result that I can have readable Japanese in Admin, copy/paste it into the same fields in the database, and get readable Japanese in the database and on the web pages but now I have unreadable junk in Admin.
Re: Japanese stopped displaying in cart, still displays in Admin
:frusty:
This was what caused the problem: 1.39 handles query encoding differently from 1.38 or future versions, as outlined here : http://www.zen-cart.com/forum/showthread.php?t=153582.
To get the utf-8 to work properly, you need to insert a one-line php file into the the includes/extra_configures folder. The name can be anything, but the contents are the single line:
<?php define('DB_CHARSET', 'utf8');
I had put that into my includes/extra_configures folder, but NOT my admin/includes/extra_configures folder. So the main storefront was interpreting the database correctly, and the admin section was mangling it.
Now, all my old customer data that looks mangled in the database (new stuff is fine) and USED to look correct in admin is mangled in admin. So I'm about to embark on the final cleanup of removing that key file again so things look good in Admin, copy/pasting them into the database directly to fix the data in the database, then putting the one line DB_CHARSET file back into the admin/includes/extra_configures folder so they look correct in Admin going forward.
Key instructions I ignored that caused this mess:
1) configure the database collation before installing the cart
2) put the one-line file in BOTH the main AND the admin includes/extra_configures folders.
Hope this helps somebody else.