JsonLD
JsonLD copied to clipboard
Failing to parse content with special chars
I'm using this with EasyRdf (@njh) and if I try to parse JSON-LD which contains unicode characters, it just halts, and I haven't managed to make it give me any errors yet. eg.
<?
$url = "https://linkedresearch.org/ldn/tests/inbox-compacted/changelog";
$response = file_get_contents($url);
var_dump($response);
echo "<hr/>";
$g = new EasyRdf_Graph($g);
$g->parse($response, 'jsonld');
var_dump($g->toRdfPhp());
?>
If you change $url to "https://linkedresearch.org/ldn/tests/inbox-compacted/announce", a JSON-LD document in otherwise the same format without any special characters, it works fine.
I don't know much about EasyRdf. Could you please check whether
echo JsonLD::toString(JsonLD::expand($url), true);
works? It works on my machine