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 21 to 40 of 145
29 Jul 2008, 7:10 AM
#21
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
399
Plugin Contributions:
6

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

I forgot this one is important too, check it please:
define('CHARSET', 'utf-8');

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

30 Jul 2008, 7:17 AM
#22
nurapipi avatar

nurapipi

New Zenner

Join Date:
Mar 2007
Posts:
6
Plugin Contributions:
0

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

Hi,
Thank you all for your response.
I did things suggested but it doesn't work.

@lazy_666
I changed query_factory.php as I posted previously, is there any other code should be changed?

@CrystalKoi
I installed a fresh Zencart but the problem is still there.
My collation settings is utf8_general_ci. I changed collation to "utf8_general_ci" from phpMyAdmin->Operations befrore I install a fresh Zencart.

@pilou2
I transferred my cart from UNIX system to another UNIX so it should be OK. And "define('CHARSET', 'utf-8');" is OK, too.

As I mentioned, if I insert data from phpMyAdmin, it can be dispalyed correctly both on phpMyAdmin and Zencart, but if I input data from Zencart, it cannot be displayed correctly.
It seems that phpMyAdmin(or MySQL!?) can pass the correct character code to Zencart, but Zencart cannot pass correct character code to phpMyAdmin(or MySQL!?).
phpMyAdmin(send) -> (receive)Zencart (O)
Zencart(send) -> (receive)phpMyAdmin (X)
so the problem happens only when Zentcart tries to insert data into MySQL. Is that possible problem of my new server's setting? Thanks again.

30 Jul 2008, 9:46 PM
#23
mikado avatar

mikado

Zen Follower

Join Date:
Nov 2007
Location:
Toulouse - France
Posts:
112
Plugin Contributions:
0

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

I have a problem with french language.

In phpMyAdmin, the collation is : utf8_unicode_ci
Jeu de caractères pour MySQL: UTF-8 Unicode (utf8)

In includes/languages/french.php :

@setlocale(LC_TIME, 'fr', 'french', 'fra', 'fr_FR', 'fr_FR@euro');
define('HTML_PARAMS','dir="ltr" lang="fr"');
define('CHARSET', 'utf-8');

In admin/includes/languages/french.php :

@setlocale(LC_TIME, 'fr', 'french', 'fra', 'fr_FR', 'fr_FR@euro');
define('HTML_PARAMS','dir="ltr" lang="fr"');
define('CHARSET', 'utf-8');

In page source of index.php :
Character Encoding-> UTF-8
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

In page source of admin/index.php :
Character Encoding-> iso-8859-1
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Does any one know what could be the reason of this issue?

1 Aug 2008, 3:51 PM
#24
nurapipi avatar

nurapipi

New Zenner

Join Date:
Mar 2007
Posts:
6
Plugin Contributions:
0

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

Hello,

Try this:
Go to your Zencart admin page,
Tools -> Developer Tool Kit
and search "iso-8859-1" from "look-up in all files" and check did you change all "iso-8859-1" to "UTF-8".

Good luck.

Mikado:

I have a problem with french language.

In phpMyAdmin, the collation is : utf8_unicode_ci
Jeu de caractères pour MySQL: UTF-8 Unicode (utf8)

In includes/languages/french.php :

@setlocale(LC_TIME, 'fr', 'french', 'fra', 'fr_FR', 'fr_FR@euro');
define('HTML_PARAMS','dir="ltr" lang="fr"');
define('CHARSET', 'utf-8');

>  
> In admin/includes/languages/french.php :
> ```
@setlocale(LC_TIME, 'fr', 'french', 'fra', 'fr_FR', 'fr_FR@euro');
define('HTML_PARAMS','dir="ltr" lang="fr"');
define('CHARSET', 'utf-8');

In page source of index.php :
Character Encoding-> UTF-8
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

In page source of admin/index.php :
Character Encoding-> iso-8859-1
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Does any one know what could be the reason of this issue?

9 Aug 2008, 12:30 PM
#25
crystalkoi avatar

crystalkoi

Zen Follower

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

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

I just did an install of this. I had to update one thing on the instructions. Changed the location of the language file for the Admin. I'm sure most people got that anyways.

I fallowed my instructions to see if I would get any problems, and all is fine.

Sorry and Good luck,

CKD

9 Aug 2008, 2:14 PM
#26
nurapipi avatar

nurapipi

New Zenner

Join Date:
Mar 2007
Posts:
6
Plugin Contributions:
0

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

Hi

I resolved my problem by changing my server provider. So my issue was nothing to do with Zencart or MySQL. Sorry to confuse you all and thanks for your advices.

15 Aug 2008, 7:09 AM
#27
yonghs avatar

yonghs

New Zenner

Join Date:
Jun 2008
Posts:
62
Plugin Contributions:
1

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

I think I have a couple of issues related to language encoding.. this seems the proper thread to ask.

I have English Zen Cart installed and then added the Simplified Chinese language pack, GB2312. Adding/viewing Chinese thru web browser is fine (product desc, categories etc)

But found a couple of issues :

  1. The order confirmation (Chinese) text-email sent out can't display the product name (the line with the quantity /product name / product code). It shows something like:
    1 x Ĉ 21; 421;Ŏ 57;È 04; 359;# 033; (AA3319) = $25.00

Other parts of the email shows chinese just fine.

  1. The search function doesn't return any results if I search with chinese words (in chinese mode)

Bcos the database is in ISO-8859??

Is there anyway to rectify without reinstalling. Just by changing the encoding of the database?

Thanks.

11 Oct 2008, 6:28 PM
#28
gleb486 avatar

gleb486

New Zenner

Join Date:
Aug 2008
Posts:
19
Plugin Contributions:
0

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

Hello! I need help please. I use ZC in two languages English and Russian. I've defined the charsets in both english.php and russian.php as UTF-8. I have converted all Rusian PHP files from ANSI to UTF-8 without BOM. I have then changed all database tables colladion to utf_general_ci. I have no problems with characters displaing but when I perform search in search engine in Russian it comes with no result. The search browser doesn't see anuthing in Russian. Can anybody help me please? Where is the problem?

15 Oct 2008, 12:03 PM
#29
radkish avatar

radkish

New Zenner

Join Date:
Oct 2008
Posts:
1
Plugin Contributions:
0

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

Hi, I have a problem with the search in my zen-car when I use UTF-8 encoding
My database is in collation utf8, charset in bulgarian.php and in english.php is utf-8 too.My DB/tables are utf8 but I can make search when type cyrillic words. It shows no results. With English word everything is OK:)
Can somebody help me?!

20 Oct 2008, 12:27 PM
#30
oschellas avatar

oschellas

New Zenner

Join Date:
Apr 2007
Location:
Athens - Greece
Posts:
7
Plugin Contributions:
1

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

See forums.oscommerce.com/index.php?showtopic=262287 for a possible solution?

13 Nov 2008, 6:25 PM
#31
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

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

Hi,
Some notes about my experience with this.
I am rebuilding a site that developed a (non-encoding-related) problem I could not solve so I started again and since I have an english-spanish site it seemed a good idea to go UTF-8 from this new start.

I followed the tutorial and all seemed to work ok.
Now I am gradually adding in the template mods I did previously.
(I’m using Notepad++ which shows the encoding of the file and can convert between different encodings and UTF-8, it reports the file encoding on the bottom right of the status bar.)

  1. Adding spanish language files (from an old contribution which I have updated to 1.38a).
    Firstly I found that any accented character was wrongly reproduced in the shop.
    Notepad++ reported the relevant language file as being ANSI encoded.
    I converted this to UTF-8, the accented characters in the file changed to unrecognised characters which once corrected displayed correctly in the shop.

  2. Next I started getting blank screens on certain places in the shop.
    I found that this was due to now having the spanish.php (or english.php) encoded as “UTF-8” instead of “UTF-8 without BOM”.
    Things seem ok now.

So, I don’t know whether I now have to convert every file in the shop whether pure php or only the language files to have things as they ”should be”?

Regards
Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

13 Nov 2008, 10:47 PM
#32
drbyte avatar

drbyte

Sensei

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

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

Language files: all should be UTF-8 without BOM.

Template files and other PHP files: any file that contains special characters should also be converted to UTF-8 without BOM. However, if you've used language constants properly, you should never need to touch any other files.

SQL files: the files in the zc_install folder are only used during installation or upgrade. As such, if your site is already installed, there's no need to convert them.

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

15 Nov 2008, 4:49 PM
#33
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

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

Thanks for that confirmation,
I just found it strange that no-one else had mentioned similar symptoms regarding the encoding of language files.

In practice Notepad++ does not "convert" a file from ANSI to UTF-8 if there are no accented chars in the file (such as in a pure php file): on reopening the file it is reported as being still ANSI.

Anyway everything seems to be working UTF-fine now so full marks to CrystalKoi,

regards
Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

2 Dec 2008, 7:37 AM
#34
addvant avatar

addvant

New Zenner

Join Date:
Aug 2005
Location:
NJ, USA
Posts:
35
Plugin Contributions:
0

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

Dear Friends,
Many thanks for this thread and the information converting the site to UTF-8.

I have done everything as written and it works fine on both the web site and Admin side. Language is Hebrew on GoDaddy shared hosting with MySql 5.

The issue we having is when we insert information from the website/admin we have everythig ok on the web/admin side but on the MySql PHP Admin we get unreadable characters.
If we key information in the MySql PHP Admin we get unreadable characters on the site/admin.
Here is sample of characters we get on the MySql PHP Admin:

'מרכזיות'

The MySql is set to ```
COLLATE utf8_general_ci

Site is <https://www.addvant.co.il>
Thanks
AddVant

**VoIP **and get more when you communicate https://www.addvant.com

2 Dec 2008, 8:23 AM
#35
crystalkoi avatar

crystalkoi

Zen Follower

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

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

@AddVant

1st, you did the database Collation before you installed Zen-Cart?

Also, you did this too?:

The next change is to query_factory.php.

NOTE:
With v1.3.9 you don't have to touch the query_factory.php file.
You should use this method instead:
http://www.zen-cart.com/forum/showthread.php?t=153582

For v1.3.8 and OLDER, use the following:

Find it in: includes/classes/db/mysql/query_factory.php

1-> Find this (line 33):

 
 // pconnect disabled ... leaving it as "connect" here instead of "pconnect"
      $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
    }
    if ($this->link) {
      if (@mysql_select_db($zf_database, $this->link)) {
        $this->db_connected = true;
        return true;
      } else {
        $this->set_error(mysql_errno(),mysql_error(), $zp_real);
        return false;
      }
    } else {
      $this->set_error(mysql_errno(),mysql_error(), $zp_real);
      return false;
    }
  }

2-> Change to this (this will not work as an override):

  
    // pconnect disabled ... leaving it as "connect" here instead of "pconnect"
      $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
    }
    if ($this->link) {
      if (@mysql_select_db($zf_database, $this->link)) {

          //BOF changed for utf-8
          mysql_query('SET NAMES "utf8"', $this->link);
          //EOF changed for utf-8
      
        $this->db_connected = true;
        return true;
      } else {
        $this->set_error(mysql_errno(),mysql_error(), $zp_real);
        return false;
      }
    } else {
      $this->set_error(mysql_errno(),mysql_error(), $zp_real);
      return false;
    }
  }
9 Dec 2008, 9:57 PM
#36
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

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

I would change all my zencart to UTF-8, for full compatibility with all browser. But I've to change into UTF-8 all my db tables?

10 Dec 2008, 7:23 AM
#38
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

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

I've already zencart 1.3.7 installed, and the collation into db is already set to utf-8

20 May 2009, 8:06 AM
#39
duul avatar

duul

New Zenner

Join Date:
May 2009
Posts:
6
Plugin Contributions:
0

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

HI,'

There is an add-on for UTF-8 fro Zen Cart 1.3.8a

UTF-8 Support for ZenCart 1.3.8a
Author: Markos Kyriacou

I am in process of installing a fresh Zen Cart 1.3.8a. After reading through the posts in this thread, I am still a little confused.

  1. Should I install a fresh copy of Zen Cart 1.3.8a and after that install the UTF-8 add-on?

  2. Should I follow the instructions of this thread and Configure the database first and follow the steps as recommended in https://www.srw2d.com/content/utf-8-zen-cart? Do I still need to install the UTF-8 add-on?

Please advise for Zen Cart newbie!

Thank You!!!!

:smile: