(percent-encode unencoded & [encoding])
Percent-encode every character in the given string using either the specified
encoding, or UTF-8 by default.
Source
(defn percent-encode
"Percent-encode every character in the given string using either the specified
encoding, or UTF-8 by default."
[^String unencoded & [^String encoding]]
(->> (.getBytes unencoded (or encoding "UTF-8"))
(map (partial format "%%%02X"))
(str/join)))