Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2008
    Posts
    9
    Plugin Contributions
    0

    Default Special characters not displaying correctly in UTF-8

    Hi,

    I had a problem with the names of categories, ezpages content, featured products content, manufacturers, not displaying correctly in UTF-8 in frontend. Having it solved successfully, I meant that the solution might interest somebody else, since I haven't found anything useful on the forum about it.

    The problem was that the database tables, from which ZC reads data for categories, ezpage, featured products etc., were initially (i.e. at the moment of installation) encoded in a wrong character set. They were encoded in latin1_swedish_ci, instead of utf8_general_ci. In MySQL, it is called collation. So, basically, the problem was due to a database issue. I managed to correct it by converting the original collation to utf-8 in the following mode:

    1. BACKUP YOUR ENTIRE DATABASE!!!!!
    2. open phpMyAdmin in your cPanel
    3. choose your ZC database and take a look at which tables (if not all) are in not utf-8 collation (encoding)
    4. click SQL tab at the top of your phpMyAdmin screen and type the following text into the "Run SQL query/queries on database xxxxxx" field:

    Code:
    ALTER TABLE name of the table DEFAULT CHARACTER SET utf8
    Run the query and that's it. You have changed the default collation for the chosen table. Check on your frontend, if special characters e.g. for your categories now display correctly in utf-8 encoding.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Special characters not displaying correctly in UTF-8

    Or use escape characters for specials
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Special characters not displaying correctly in UTF-8

    I would suggest that the next version of ZC installation instructions should contain a recommendation to international users, that it is advisable to create the ZC database in a collation, supporting their national charset or directly in utf-8 (provided the inclusion of an utf-8 support in the next version of ZC). In that case, many difficulties will be avoided.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Special characters not displaying correctly in UTF-8

    latin1_swedish_ci is fairly universal

    collation and char set are different animals
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jul 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Special characters not displaying correctly in UTF-8

    Well, the swedish collation didn't work for me. Utf-8 did. For the rest, you can be utterly right, since I am a beginner in these things.

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Special characters not displaying correctly in UTF-8

    You might check for the future setting your lang char set in english.php
    Code:
      @setlocale(LC_ALL, 'en_US.ISO_8859-1');
      define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
      define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
      define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
      define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Special characters not displaying correctly in UTF-8

    Quote Originally Posted by kobra View Post
    collation and char set are different animals
    This is very true.
    .

    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.

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Special characters not displaying correctly in UTF-8

    Quote Originally Posted by DrByte
    This is very true.
    And if interested in reading - one can google for it and it is very confusing and not sure that anyone "fully" has a handle on it
    Zen-Venom Get Bitten

  9. #9
    Join Date
    Jul 2009
    Location
    NorthEastern United States
    Posts
    4
    Plugin Contributions
    0

    Default Re: Special characters not displaying correctly in UTF-8

    Note: This was originally posted in another thread but I wanted to come back into here to help anyone else who was still stryggling with the issue.


    http://www.zen-cart.com/forum/showthread.php?t=36382

 

 

Similar Threads

  1. v154 so 1.54 does not support special characters?
    By travbacon in forum General Questions
    Replies: 5
    Last Post: 24 Jun 2015, 01:50 PM
  2. Replies: 3
    Last Post: 22 Nov 2013, 03:29 PM
  3. Special Characters not working for SMTPauth password
    By ray-the-otter in forum Bug Reports
    Replies: 2
    Last Post: 6 Oct 2011, 04:38 PM
  4. Problems with displaying Russian characters and UTF-8
    By pcontente in forum Addon Language Packs
    Replies: 31
    Last Post: 4 Mar 2011, 03:22 PM
  5. German characters do not appear correctly
    By markus75 in forum General Questions
    Replies: 9
    Last Post: 20 May 2009, 11:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR