Skip to main content

decode

Function decode 

Source
pub fn decode(input: &str) -> Result<Cow<'_, str>, DecodeError>
Expand description

Percent-decodes a string per RFC 3986.

Returns the input borrowed when no % is present. Otherwise decodes %HH pairs (hex is case-insensitive) and leaves any % that is not followed by two hex digits in place.

ยงErrors

Returns DecodeError::InvalidUtf8 if the decoded bytes are not valid UTF-8.