Strange chars in JSON (obtained after cURL auth) Strange chars in JSON (obtained after cURL auth) curl curl

Strange chars in JSON (obtained after cURL auth)


When you call json_decode in PHP on strings that contain these encodings they will be correctly decoded. http://json.org/ lists \ufour-hex-digits as a valid character. There is no issue.

$ echo json_decode('"\u003E\u003C/a\u003E\u003C/p\u003E\n\u003Cp\u003E"');></a></p><p>


They are valid unicode sequence. Here is a simple example

$data = array(        "abc" => 'åbcdéfg');// Encode$data = json_encode($data) . "\n";// Output Valueecho $data;// Output Decoded Valueprint_r(json_decode($data));

Output

{"abc":"\u00e5bcd\u00e9fg"}stdClass Object(    [abc] => åbcdéfg)