encode_uri

Function encode_uri 

Source
pub fn encode_uri<T: AsRef<[u8]>>(url: T) -> String
Expand description

Percent-encode an entire URI string that is valid UTF-8.

encode_uri escapes all characters except a-z A-Z 0-9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #.

ยงExamples

use aidoku::helpers::uri::encode_uri;
assert_eq!(
    encode_uri("http://www.example.org/a file with spaces.html"),
    "http://www.example.org/a%20file%20with%20spaces.html",
)