(percent-decode encoded & [encoding])
Decode every percent-encoded character in the given string using the
specified encoding, or UTF-8 by default.
Source
(defn percent-decode
"Decode every percent-encoded character in the given string using the
specified encoding, or UTF-8 by default."
[^String encoded & [^String encoding]]
(str/replace encoded
#"(?:%[A-Za-z0-9]{2})+"
(fn [chars]
(-> ^bytes (parse-bytes chars)
(String. (or encoding "UTF-8"))
(fix-string-replace-bug)))))