Expand description
Functions for encoding and decoding percent-encoded path components.
libdav follows the same convention, and so should dependant software:
- An
Urihas its path component percent-encoded. TheUritype enforces validation of this. Additionally, allUriinstances produced by this library have their component normalised withstrict_percent_encoded. hrefstrings shall have only reserved characters percent-encoded. This makes them better suitable for display, and for usage in filenames. These are frequently encoded into XML, so do not require escaping non-reserved characters. Handling of XML entities is done internally by libdav; consumers need not concern themselves with this.
Hrefs should be treated as opaque strings. These MAY be percent-encoded, but keep in mind that decoding them and re-encoding them may not yield the same result. From RFC3986, section 2.2:
URIs that differ in the replacement of a reserved character with its corresponding percent-encoded octet are not equivalent. Percent- encoding a reserved character, or decoding a percent-encoded octet that corresponds to a reserved character, will change how the URI is interpreted by most applications. Thus, characters in the reserved set are protected from normalization and are therefore safe to be used by scheme-specific and producer-specific algorithms for delimiting data subcomponents within a URI.
See this short article for more details.
Enums§
- Returned when invalid input is provided to
normalise_percent_encoded.
Functions§
- Normalise a percent encoded path.
- Percent-encode most characters in a path.