I recently got the Dota 2 item schema by following this guide: http://roshpit.ghost.io/getting-updated-item-schema-for-dota2-despite-app570econ-api-being-down-for-5-months/
Since the file is really large, every time I attempt to verify it with json verifiers such as JSONLint, they stop responding. It looks like proper json, and according to the guide it should be proper json. My problem is that when I use json_decode()
in PHP it ends up returning a null or empty.
My guess is that it includes some type of character that is not supported by PHP and thus causing it to return null. I read something regarding UTF8 BOM
, but I'm not sure if this is the problem.
Could someone help me identify what's wrong with it?
I have used var_dump()
to make sure that the contents of the object that I am trying to decode actually has something.
I have also tried removing the UTF8 BOM
characters by using the following php function
function remove_utf8_bom($text)
{
$bom = pack('H*','EFBBBF');
$text = preg_replace("/^$bom/", '', $text);
return $text;
}
And I also tried removing the UTF8 BOM
characters using this awk script
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}{print}' INFILE > OUTFILE
Neither of the UTF8 BOM
removals seemed to have any effect.
The following is the json file in question: