Handles lack of JSON_HEX_TAG and JSON_HEX_AMP in PHP 5.2