I have this black box that spits out a JSON, and this file comes with what I assume, are escaped Unicode characters. Here's a snippet:
{
"AR_DESCRI":"LIMA CENTIMETRADA\/FORMAS U\u00c3\u2018AS 100\/180 MANI."
}
Now, here's how the resulting JSON should actually look like to any reasonable human being:
{
"AR_DESCRI":"LIMA CENTIMETRADA/FORMAS UÑAS 100/180 MANI."
}
The most importat thing there is that \u00c3\u2018
should equal the Ñ
character.
However as you can check from any Unicode Escape Sequence decoder, this is not the case, the ouput for \u00c3\u2018
is actually Ñ
which is basically random noise.
I've tried some online decoders and I've also used the json_decode()
PHP functions, which is the enviroment I'm currently working on. Both give me the same results. Here's the snippet of code if you are curious:
<?php
$json = '{"AR_DESCRI":"LIMA CENTIMETRADA\/FORMAS U\u00c3\u2018AS 100\/180 MANI."}';
print_r(json_decode($json));
//Output: stdClass Object ( [AR_DESCRI] => LIMA CENTIMETRADA/FORMAS UÑAS 100/180 MANI. )
So my question is, why on earth does this happen, is it an encoding issue on the black box's side? Am I using the wrong function?
Thanks in advance.