Skip to content

Instantly share code, notes, and snippets.

@lucasad
Created September 7, 2013 09:40
Show Gist options
  • Save lucasad/6474224 to your computer and use it in GitHub Desktop.
Save lucasad/6474224 to your computer and use it in GitHub Desktop.

Revisions

  1. @Nykac Nykac created this gist Sep 7, 2013.
    5 changes: 5 additions & 0 deletions urlencode.zsh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    urlencode() {
    setopt localoptions extendedglob
    input=( ${(s::)1} )
    print ${(j::)input/(#b)([^A-Za-z0-9_.\!~*\'\(\)-])/%${(l:2::0:)$(([##16]#match))}}
    }