Home » Solved Issues

Funny Character Issue in Zen Cart – SOLVED

26 April 2010 2 Comments

Posts and pages

Recently I came across the issue of funny character for one of our client websie developed in Zen Cart. I have searched almost more than 10+ forums including zen cart forums. But couldnt find the root of the issue. But I have found out the issue from one site that that might be character encoding issue.

Zen cart settings was for Latin 8859 – 1 which was the root of the issue of funny character.

I have set up UTF-8 Unicode character set encoding for 3 files and it works like a charm.

I have made changes in 3 files.

1) includes/languages/YOUR_LANGUAGE.php

Change Line @setlocale(LC_TIME, ‘en_US.ISO_8859-1′); To @setlocale(LC_TIME, ‘en_US.utf8′);

and Change Line define(‘CHARSET’, ‘iso-8859-1′); To define(‘CHARSET’, ‘utf-8′);

2) admin/includes/languages/YOUR_LANGUAGE.php

Change Line define(‘CHARSET’, ‘iso-8859-1′); To define(‘CHARSET’, ‘utf-8′);

3) includes/classes/db/mysql/query_factory.php

Find out if (@mysql_select_db($zf_database, $this->link)) in that if function replace $this->db_connected = true; return true;

with

if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {
            mysql_query('SET NAMES "utf8"', $this->link);
        $this->db_connected = true;

        return true;

      } else {

        $this->set_error(mysql_errno(),mysql_error(), $zp_real);

        return false;

      } 

4) You need to Change Character settings in Database.

Go To PhpMyAdmin > Select Database > Operations > Collation Dropdown – Select utf8_general_ci and press Go.

Now, you have set character set in Zen cart, MySql Database but you need to check that actually they are active or not..

For that There are two process to check character set of a webpage.

1) Mozilla Firefox – Go to View > Character Encoding > Check ( Unicode Utf- 8 ) is selected or not. If selected then you can say that your page is set to utf-8 encoding.

2) Viewsource of sites index page.

go to site and on Mozill View > Page source ( or Press Ctrl + U ) and check that meta charactor encoding is set to utf-8 or not.

Thanks,

Hope this helps….

2 Comments »

  • Sam Lee said:

    Excellent!!!

    That’s the exact solution I’m after.

    Well done. Thanks!

  • WP Themes said:

    Amiable dispatch and this enter helped me alot in my college assignement. Thank you for your information.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.