Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default [Fixed v1.5.1] PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    1.5.0 final upgraded from 1.3.6

    When updating a products description with special characters the error log shows:
    PHP Warning: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in /home/domains/elektro.nl/public_html/admin/includes/init_includes/init_admin_history.php on line 34
    Not sure if it's related, but I also noticed that all the database tables are latin encoded, except for admin_menus, admin_pages, admin_pages_to_profiles and admin_profiles
    (admin_activity_log is encoded latin).

    Other than the above error log everything seems to work fine, but I would like to keep the error log clean

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    Paul - I think it was yesterday - but someone else posted about a json_encode problem - turned out to be something with the hosting.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    Thanks Kim, but I think you mean the post about the Fatal error undefined function: json_encode(), which seems quite a different problem.

    In case it's related to the json version, the installed version is 1.2.1

  4. #4
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    According to the json_encode documentation on php.net:
    This function only works with UTF-8 encoded data.
    So it seems that the problem is the latin encoding combined with the json_encode function.

    Does this mean it's required to convert the database to UTF8 when upgrading to Zen Cart 1.5.0 ? I thought I read somewhere this conversion wasn't required.

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

    Default Re: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    I'm unable to replicate the problem you're indicating.

    What do I need to do to my installation to trigger your problem?
    .

    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.

  6. #6
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    To replicate I think you need a 1.5.0. store with a Latin encoded database (or other non UTF8 encoding), and then update a products description containing a special character.

    That's my guess, I haven't tried to replicate it yet.

  7. #7
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    Forgot to mention that, although it's an upgrade, the admin files are still orginal 1.5.0, except for the language pack (which is Dutch iso).

  8. #8
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in...

    I have come to the conclusion that this error is not important.

    As a quick fix I convert the admin logs to UTF-8. And I will later convert the whole shop to UTF-8, which will prevent problems like this.

 

 

Similar Threads

  1. Replies: 9
    Last Post: 11 Dec 2015, 11:35 PM
  2. Replies: 2
    Last Post: 20 May 2013, 04:09 AM
  3. PHP Warning: json_encode() Invalid UTF-8 sequence in argument
    By m.digregorio in forum General Questions
    Replies: 1
    Last Post: 15 Oct 2012, 08:30 PM
  4. Replies: 8
    Last Post: 19 Sep 2012, 03:37 AM
  5. Replies: 5
    Last Post: 15 Jul 2009, 05:18 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