You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • As @DrAzzy says, looks like that's probably not 'real' JavaScript, but is calling into internal V8 functions...

    As there's no unicode it's simplified quite a bit - you could probably get away with:

    function encodeURIComponent(s) { 
      var ok = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm­nopqrstuvwxyz0123456789";
      var r = "";
      for (var i=0;i<s.length;i++) { 
        if (ok.indexOf(s[i])>=0) r+=s[i];
        else r+= "%"+(256+s.charCodeAt(i)).toString(16).s­ubstr(-2);
      }
      return r;
    }
    
About

Avatar for Gordon @Gordon started