Liking cljdoc? Tell your friends :D

dk.simongray.whatwg-url.percent

Percent-encoding and percent-decoding, by the percent-encode sets of the URL Standard, section 1.3.

Each set is a predicate of a code point, so a set of your own is a function too, e.g. (some-fn percent/path-set #{0x3B}). Every set of the standard holds the code points above U+007E.

TODO: the encodings other than UTF-8 that HTML passes to the parser for the query of a document in a legacy encoding.

Percent-encoding and percent-decoding, by the percent-encode sets of
the URL Standard, section 1.3.

Each set is a predicate of a code point, so a set of your own is a
function too, e.g. (some-fn percent/path-set #{0x3B}). Every set of the
standard holds the code points above U+007E.

TODO: the encodings other than UTF-8 that HTML passes to the parser for
the query of a document in a legacy encoding.
raw docstring

c0-control-setclj/s

The C0 control percent-encode set.

The C0 control percent-encode set.
sourceraw docstring

component-setclj/s

The component percent-encode set, which encodes what JavaScript's encodeURIComponent encodes.

The component percent-encode set, which encodes what JavaScript's
encodeURIComponent encodes.
sourceraw docstring

decodeclj/s

(decode s)

The text s with its percent-encoded bytes decoded as UTF-8, with U+FFFD for each sequence that isn't UTF-8. A % that starts no percent-encoded byte stays a %.

(decode "%E2%80%BD%25%2E")
;; => "‽%."
The text `s` with its percent-encoded bytes decoded as UTF-8, with
U+FFFD for each sequence that isn't UTF-8. A % that starts no
percent-encoded byte stays a %.

    (decode "%E2%80%BD%25%2E")
    ;; => "‽%."
sourceraw docstring

decode-bytesclj/s

(decode-bytes s)

The bytes of the text s in UTF-8, with each percent-encoded byte decoded, as a vector of numbers. A % that starts no percent-encoded byte stays a %.

The bytes of the text `s` in UTF-8, with each percent-encoded byte
decoded, as a vector of numbers. A % that starts no percent-encoded byte
stays a %.
sourceraw docstring

encodeclj/s

(encode s)
(encode s set)

The text s with each code point in the percent-encode set percent-encoded as UTF-8. The set is component-set unless given.

(encode "Say what‽")
;; => "Say%20what%E2%80%BD"

With form-urlencoded-set a space becomes a +, as in the body of a form.

The text `s` with each code point in the percent-encode `set`
percent-encoded as UTF-8. The set is component-set unless given.

    (encode "Say what‽")
    ;; => "Say%20what%E2%80%BD"

With form-urlencoded-set a space becomes a +, as in the body of a form.
sourceraw docstring

form-urlencoded-setclj/s

The application/x-www-form-urlencoded percent-encode set, which leaves only the ASCII letters and digits and * - . _ as they are. Encoding by it turns a space into a +.

The application/x-www-form-urlencoded percent-encode set, which leaves
only the ASCII letters and digits and * - . _ as they are. Encoding by
it turns a space into a +.
sourceraw docstring

fragment-setclj/s

The fragment percent-encode set.

The fragment percent-encode set.
sourceraw docstring

path-setclj/s

The path percent-encode set.

The path percent-encode set.
sourceraw docstring

query-setclj/s

The query percent-encode set.

The query percent-encode set.
sourceraw docstring

special-query-setclj/s

The special-query percent-encode set, for the query of a URL with a special scheme, e.g. https.

The special-query percent-encode set, for the query of a URL with a
special scheme, e.g. https.
sourceraw docstring

userinfo-setclj/s

The userinfo percent-encode set.

The userinfo percent-encode set.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close