Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2005
    Posts
    174
    Plugin Contributions
    0

    Default UTF8 and special characters after upgrade

    Hello,

    I have a UTF8 site set up. Everything was working fine until we upgraded to the latest version of Zen Cart. When doing that, all the special characters started showing strangely.

    é is now é for example.

    For a quick fix, I did a find and replace in the database to change these characters to their escape characters, but now "é" is showing in the plain text emails sent from the site.

    Database collation is utf8_general_ci and products_name is "varbinary," while products_description is "blob."

    To try to solve this, I added this file:

    includes/extra_configures/my_db_charset.php - set to define('DB_CHARSET', 'utf8');

    I also set the character set in zc_install when upgrading, as per a post I saw on the forums.

    I also see this:

    includes/functions/functions_general.php

    Line #1513 : * convert supplied string to UTF-8, dropping any symbols which cannot be translated easily
    Line #1518 : function charsetConvertWinToUtf8($string) {
    Line #1520 : $string = htmlentities($string, ENT_QUOTES, 'UTF-8');
    Line #1530 : if (CHARSET == 'UTF-8') return $string;
    Line #1532 : $string = htmlentities($string, ENT_QUOTES, 'UTF-8');

    What can I do to get these characters showing correctly? Thanks!

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

    Default Re: UTF8 and special characters after upgrade

    Two things:

    a) replacing the characters in your database just breaks things worse
    b) when you upgraded, did you keep your existing database intact and just run the zc_install upgrade against it, as per the instructions? Or did you import it to *another* database and take *that* database live? If so, then the import process likely lost all the correct character handling, resulting in bad data.
    .

    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.

  3. #3
    Join Date
    Mar 2005
    Posts
    174
    Plugin Contributions
    0

    Default Re: UTF8 and special characters after upgrade

    Hello!

    No importing, I just ran the database upgrade! That's what's so puzzling.

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

    Default Re: UTF8 and special characters after upgrade

    No importing, I just ran the database upgrade!
    Did you backup the database before doing this??

    Restore it and determine the character set you were originally using

    What is it?
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Mar 2005
    Posts
    174
    Plugin Contributions
    0

    Default Re: UTF8 and special characters after upgrade

    Yes I did.

    Before the upgrade:
    DEFAULT CHARSET=utf8

    After the upgrade:
    DEFAULT CHARSET=utf8

    When I use WinMerge to compare the two databases (before and after upgrade exports), I don't see any differences to the character set between the two.

    During the upgrade, it stopped partway through and gave me the error mentioned in this thread:
    http://www.zen-cart.com/forum/showthread.php?t=157297

    I tried all the tips, but none of them worked, so I just ran the last few commands on the database by hand. Ideas?

  6. #6
    Join Date
    Mar 2005
    Posts
    174
    Plugin Contributions
    0

    Default Re: UTF8 and special characters after upgrade

    Additionally, if I edit a product from the admin (instead of the database) to add a é to a word, the accented e turns into a question mark.

    I don't care too much how this happened, but would like to know the quickest/simplest way to get special characters working again, thanks!

  7. #7
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: UTF8 and special characters after upgrade


 

 

Similar Threads

  1. v151 special characters and search
    By earmsby in forum General Questions
    Replies: 11
    Last Post: 10 Mar 2016, 04:46 PM
  2. v151 UTF8 Special Characters not coming thru in Meta Title/Description
    By Feznizzle in forum General Questions
    Replies: 4
    Last Post: 20 Oct 2015, 07:59 PM
  3. Special characters in products and categories
    By familynow in forum Setting Up Categories, Products, Attributes
    Replies: 19
    Last Post: 8 Mar 2015, 06:41 PM
  4. French translation and special characters
    By Jatt in forum Addon Language Packs
    Replies: 23
    Last Post: 19 Nov 2012, 06:32 PM
  5. Email and special characters
    By akarui in forum General Questions
    Replies: 1
    Last Post: 8 Jun 2010, 03:15 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