(url-encode unencoded & [encoding])
Returns the url-encoded version of the given string, using either a specified
encoding or UTF-8 by default.
Source
(defn url-encode
"Returns the url-encoded version of the given string, using either a specified
encoding or UTF-8 by default."
[unencoded & [encoding]]
(str/replace
unencoded
#"[^A-Za-z0-9_~.+-]+"
#(double-escape (percent-encode % encoding))))