Results 1 to 1 of 1

Thread: json_encode(): Invalid UTF-8 sequence in argument

  1. #1
    Thread Starter
    Veteran weiching's Avatar
    Join Date
    Apr 2011
    Posts
    505
    Thanks
    85
    Thanked 43 Times in 38 Posts

    json_encode(): Invalid UTF-8 sequence in argument

    Hello,

    I found this in the host error_log:

    PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in /home/www/public_html/wp-includes/functions.php on line 2669

    ClassiPress 3.4.1
    WordPress 4.2.3
    PHP Version 5.3.29
    MySQL Version 5.5.42

    functions.php on line 2669
    PHP Code:
        $json call_user_func_array'json_encode'$args ); 
    PHP Code:
    function wp_json_encode$data$options 0$depth 512 ) {
        
    /*
         * json_encode() has had extra params added over the years.
         * $options was added in 5.3, and $depth in 5.5.
         * We need to make sure we call it with the correct arguments.
         */
        
    if ( version_comparePHP_VERSION'5.5''>=' ) ) {
            
    $args = array( $data$options$depth );
        } elseif ( 
    version_comparePHP_VERSION'5.3''>=' ) ) {
            
    $args = array( $data$options );
        } else {
            
    $args = array( $data );
        }

        
    $json call_user_func_array'json_encode'$args );

        
    // If json_encode() was successful, no need to do more sanity checking.
        // ... unless we're in an old version of PHP, and json_encode() returned
        // a string containing 'null'. Then we need to do more sanity checking.
        
    if ( false !== $json && ( version_comparePHP_VERSION'5.5''>=' ) || false === strpos$json'null' ) ) )  {
            return 
    $json;
        }

        try {
            
    $args[0] = _wp_json_sanity_check$data$depth );
        } catch ( 
    Exception $e ) {
            return 
    false;
        }

        return 
    call_user_func_array'json_encode'$args );

    How to fix it?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Warning: Invalid argument supplied
    By laurent in forum AppStats
    Replies: 1
    Last Post: April 23rd, 2015, 07:34 AM
  2. Getting a invalid argument warning
    By benobies in forum Help Using Vantage (Legacy)
    Replies: 6
    Last Post: October 6th, 2014, 03:00 PM
  3. [SOLVED] Warning: Invalid argument supplied for foreach()
    By clapboom in forum Report Vantage Bugs (Legacy)
    Replies: 4
    Last Post: February 27th, 2014, 02:45 PM
  4. Dimitris Warning: invalid argument suppplied for foreach [VANTAGE]
    By cfajardo79 in forum Report Vantage Bugs (Legacy)
    Replies: 5
    Last Post: December 20th, 2013, 11:24 AM
  5. Replies: 1
    Last Post: June 18th, 2012, 07:24 AM