JSONPolling. Encode packet string for JSONP response