Weird parsing of unicode characters
theofidry opened this issue · comments
Théo FIDRY commented
Given the following JSON:
{
"errors": [
{
"message": "Argument \u0022input\u0022 has an invalid value: ...."
}
]
}
(for some reason a mink driver is returning this instead of \"
...)
With json_decode()
you will get:
{#4
+"errors": array:1 [
0 => {#5
+"message": "Argument "input" has an invalid value: ...."
}
]
}
However with JsonParser
you will get:
{#17
+"errors": array:1 [
0 => {#16
+"message": "Argument "input" has an invalid value: ...."
}
]
}
Any idea of how this could be fixed?
Jordi Boggiano commented
Looks like possibly a bug in https://github.com/Seldaek/jsonlint/blob/master/src/Seld/JsonLint/JsonParser.php#L471 - have a look?
Théo FIDRY commented
Will try, thanks for the pointer
Théo FIDRY commented
For my future self, might be of some help: zaach/jsonlint#54