Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2005
    Location
    UK
    Posts
    38
    Plugin Contributions
    0

    Default Character Set Problem – PHP warning in general.php

    I keep getting the following warning in a debug file when accessing certain pages in admin. Not all but seems to be when there’s a UK Pound sign around and the message is repeated a number of times in the file.

    [25-May-2012 15:14:09] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: charset `latin1' not supported, assuming iso-8859-1 in /home/pointesh/public_html/shop/admin/includes/functions/general.php on line 39

    I had problems on getting currency symbols to display correctly when updating the database from my 1.39 store to 1.5 but after following the various threads and the link at https://www.zen-cart.com/tutorials/i...hp?article=414 managed to get it working with the following in both admin and store files:

    configure.php - define('DB_CHARSET', 'latin1');

    english.php - @setlocale(LC_TIME, 'en_GB.ISO_8859-1'); and define('CHARSET', 'latin1');

    I’m using &pound:, &euro; and &yen; in the currencies table.

    The store and admin are working fine and displaying correctly but I have a feeling if I don’t put this right it could come back to haunt me at a future database upgrade.

    Anyone else seen this problem and know of a possible solution?

  2. #2
    Join Date
    Mar 2005
    Location
    UK
    Posts
    38
    Plugin Contributions
    0

    Default Re: Character Set Problem – PHP warning in general.php

    Just an update.

    I changed "latin1" to "utf8" in the above files and have the same problem although again the currency symbols all display correctly.

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

    Default Re: Character Set Problem – PHP warning in general.php

    If you have been using mixed character sets and thereby stored data in your database in one character set and then switch to another character set then you'll run into those kinds of problems until you clean up the characters which are invalid in the character set you're using.

    You can safely use &pound; instead of the actual £ character. But if you've stored the actual £ character then if you switch character sets you'll have troubles since it's a special character.

    Clean up the bad data that you've stored, and then your problems will go away.

    Sorry, no I don't have a magic tool that tells you where/what all your bad characters are.
    .

    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.

  4. #4
    Join Date
    Mar 2005
    Location
    UK
    Posts
    38
    Plugin Contributions
    0

    Default Re: Character Set Problem – PHP warning in general.php

    DrByte

    Thanks for the advice and answering my next question even before I asked it. You don't know the next lottery numbers do you?

    Good news, all is now working withour warnings using the following settings:

    configure.php - define('DB_CHARSET', 'uft8');

    english.php - @setlocale(LC_TIME, 'en_GB.ISO_uft-8'); and define('CHARSET', 'uft-8');

 

 

Similar Threads

  1. Replies: 9
    Last Post: 11 Dec 2015, 11:35 PM
  2. Replies: 0
    Last Post: 25 Dec 2014, 04:57 PM
  3. Replies: 18
    Last Post: 11 Mar 2013, 04:11 PM
  4. Replies: 8
    Last Post: 19 Sep 2012, 03:37 AM
  5. php email not sending out with correct character set
    By mahalo in forum General Questions
    Replies: 5
    Last Post: 10 Jun 2007, 03:47 PM

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