Fix encoding of html entities so json_encode can parse properly.