normalize_uri_element

Function normalize_uri_element 

Source
pub fn normalize_uri_element(
    uri_el: &str,
    uri_el_type: UriElement,
) -> Result<String, SignatureError>
Available on crate feature unstable only.
Expand description

Normalize the URI or query string according to RFC 3986. This performs the following operations:

  • Alpha, digit, and the symbols -, ., _, and ~ (unreserved characters) are left alone.
  • Characters outside this range are percent-encoded.
  • Percent-encoded values are upper-cased (%2a becomes %2A)
  • Percent-encoded values in the unreserved space (%41-%5A, %61-%7A, %30-%39, %2D, %2E, %5F, %7E) are converted to normal characters.

If a percent encoding is incomplete, an error is returned.