Skip to main content

quote_from_bytes

Function quote_from_bytes 

Source
pub fn quote_from_bytes(bytes: &[u8], safe: &str) -> String
Expand description

Like quote, but takes a byte slice directly and does no string-to-bytes encoding. Always returns an ASCII string. Port of quote_from_bytes.

use urlparse_rs::quote_from_bytes;
assert_eq!(quote_from_bytes(b"abc def\x3f", "/"), "abc%20def%3F");