Handles lack of JSON_HEX_APOS and JSON_HEX_QUOT in PHP 5.2. Fixes JSON_HEX_TAG handling.