Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    California
    Posts
    8
    Plugin Contributions
    0

    Default special character problem - otion values

    I am having a problem with the display of special characters (non-ASCII) in my Zencart pages, but only in the names of product option values.

    The special characters are entered in the database as numeric character references.

    The special characters display correctly in the products page. However, in the shopping cart contents and the confirmation page, the names of product options values do not display correctly. Note, however, that the names of product options do display correctly with the same characters.

    Example: the word ĝis is displayed incorrectly as & #285;is.

    OS: Windows XP
    Zencart 1.3.8
    Language: English
    english.php contains the line define('CHARSET', 'utf-8');
    database charset is utf-8
    database connection collation is utf-unicode-ci
    the collation value for product options and product options values is utf-unicode-ci

    I would appreciate any help with this problem.
    I apologize in advance if this post is in the wrong place.

    Thank you.
    Last edited by billharris; 19 Dec 2008 at 06:38 PM.

  2. #2
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,927
    Plugin Contributions
    4

    Default Re: special character problem - otion values

    Hi,

    I have a reasonably good idea of why this is happening,

    Could you post the version of Zen Cart you are using, and the version of PHP your server uses.

    Ian

  3. #3
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,927
    Plugin Contributions
    4

    Default Re: special character problem - otion values

    k, the reason why the output is broken is due to the zen_output_string_protected function.

    We use this on cart/confirmation for value names, as some of these may have been provided by the user, if you use the TEXT option type,

    zen_output_string_protected uses htmlspecialchars on the output string. This will convert all & signs in the output string to &

    so &258; becomes &amp258;, hence why it displays as such.

    Can I ask why you use the entity value and don't just enter the character in admin as ĝ
    Last edited by wilt; 19 Dec 2008 at 08:57 PM.

  4. #4
    Join Date
    Aug 2008
    Location
    California
    Posts
    8
    Plugin Contributions
    0

    Default Re: special character problem - otion values

    Quote Originally Posted by wilt View Post
    k, the reason why the output is broken is due to the zen_output_string_protected function.

    We use this on cart/confirmation for value names, as some of these may have been provided by the user, if you use the TEXT option type,

    zen_output_string_protected uses htmlspecialchars on the output string. This will convert all & signs in the output string to &

    so &258; becomes &amp258;, hence why it displays as such.

    Can I ask why you use the entity value and don't just enter the character in admin as ĝ
    I'm sorry, my example was not quite correct.
    I use a software program that enters the ĝ as an ampersand followed by a pound sign followed by the three digits 285 followed by a semicolon. I think that is standard NCR notation.

    I can see that the htmlspecialchars function would give the results that I am getting.
    However, I have an option that asks for text input. If the user enters a special character such as the ĝ, it is displayed correctly in the shopping cart and confirmation page. Only the option values names seem to be affected.

    I don't know of any way to enter these special characters without using an ampersand. How can I best solve my problem?

    Thanks,

  5. #5
    Join Date
    Aug 2008
    Location
    California
    Posts
    8
    Plugin Contributions
    0

    Default Re: special character problem - otion values

    I managed to solve my problem by modifying the PHP code to apply the zen_output_string_protected function to text option_values only
    in the shopping cart, the confirmation, and the order history.

    Thank you for your help.

 

 

Similar Threads

  1. v139g City name special character
    By Cenkki in forum Managing Customers and Orders
    Replies: 3
    Last Post: 13 Jun 2014, 06:09 PM
  2. HTML Special Character and Plain Text Editor (1.3.8)
    By chadderuski in forum General Questions
    Replies: 2
    Last Post: 16 Aug 2011, 05:53 PM
  3. Special Character Problem in Store Products (not in admin)?
    By sephiroth in forum General Questions
    Replies: 2
    Last Post: 24 Mar 2011, 06:44 PM
  4. Strange character problem
    By Joakim in forum General Questions
    Replies: 0
    Last Post: 30 Apr 2007, 08:53 AM

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