Skip to content

Instantly share code, notes, and snippets.

@josher19
Created June 18, 2012 02:15
Show Gist options
  • Save josher19/2946430 to your computer and use it in GitHub Desktop.
Save josher19/2946430 to your computer and use it in GitHub Desktop.
escape all letters
var esc = function (c) { var x=parseInt(c, 36); return isFinite(x) ? "%" + (x+87).toString(16) : c; }
var escw = function(word) { return word.replace(/[a-z]/g, esc); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment