public static function encode($value, $options = 0, $depth = 512)
    {
        // multi-characters supported by default
        $options |= JSON_UNESCAPED_UNICODE;

        $data = version_compare(PHP_VERSION, '5.5.0', '>=')
            ? json_encode($value, $options, $depth)
            : json_encode($value, $options);

        if (JSON_ERROR_NONE !== json_last_error()) {
            return $data;
        }

        return version_compare(PHP_VERSION, '5.4.0', '>=')
            ? $data
            : preg_replace_callback("/\\\\u([0-9a-f]{2})([0-9a-f]{2})/iu", function ($pipe) {
                return iconv(
                    strncasecmp(PHP_OS, 'WIN', 3) ? 'UCS-2BE' : 'UCS-2',
                    'UTF-8',
                    chr(hexdec($pipe[1])) . chr(hexdec($pipe[2]))
                );
            }, $data);
    }
public static function encode($value, $options = 0, $depth = 512)
    {
        // multi-characters supported by default
        $options |= JSON_UNESCAPED_UNICODE;

        $data = version_compare(PHP_VERSION, '5.5.0', '>=')
            ? json_encode($value, $options, $depth)
            : json_encode($value, $options);

        if (JSON_ERROR_NONE !== json_last_error()) {
            return $data;
        }

        return version_compare(PHP_VERSION, '5.4.0', '>=')
            ? $data
            : preg_replace_callback("/\\\\u([0-9a-f]{2})([0-9a-f]{2})/iu", function ($pipe) {
                return iconv(
                    strncasecmp(PHP_OS, 'WIN', 3) ? 'UCS-2BE' : 'UCS-2',
                    'UTF-8',
                    chr(hexdec($pipe[1])) . chr(hexdec($pipe[2]))
                );
            }, $data);
    }
public static function encode ( $ value , $ options = 0 , $ depth = 512 ) { // multi-characters supported by default $ options |= JSON_UNESCAPED_UNICODE ; $ data = version_compare ( PHP_VERSION , '5.5.0' , '>=' ) ? json_encode ( $ value , $ options , $ depth ) : json_encode ( $ value , $ options ) ; if ( JSON_ERROR_NONE !== json_last_error ( ) ) { return $ data ; } return version_compare ( PHP_VERSION , '5.4.0' , '>=' ) ? $ data : preg_replace_callback ( "/\\\\u([0-9a-f]{2})([0-9a-f]{2})/iu" , function ( $ pipe ) { return iconv ( strncasecmp ( PHP_OS , 'WIN' , 3 ) ? 'UCS-2BE' : 'UCS-2' , 'UTF-8' , chr ( hexdec ( $ pipe [ 1 ] ) ) . chr ( hexdec ( $ pipe [ 2 ] ) ) ) ; } , $ data ) ; }
PHP >= 5.3 JSON_UNESCAPED_UNICODE constant supported

@param mixed $value   The value (except a resource) being encoded.
@param int   $options Bitmask consisting of blah...
@param int   $depth   Set the maximum depth. Must be greater than zero.

@see http://php.net/manual/en/function.json-encode.php

@return mixed Returns a string containing the JSON representation of data
PHP > = 5 . 3 JSON_UNESCAPED_UNICODE constant supported