1 use percent_encoding
::{utf8_percent_encode, AsciiSet}
;
3 /// This used to be: `SIMPLE_ENCODE_SET` plus space, `"`, `#`, `<`, `>`, backtick, `?`, `{`, `}`
4 pub const DEFAULT_ENCODE_SET
: &AsciiSet
= &percent_encoding
::CONTROLS
// 0..1f and 7e
5 // The SIMPLE_ENCODE_SET adds space and anything >= 0x7e (7e itself is already included above)
8 // the DEFAULT_ENCODE_SET added:
19 /// percent encode a url component
20 pub fn percent_encode_component(comp: &str) -> String {
21 utf8_percent_encode(comp, percent_encoding::NON_ALPHANUMERIC).to_string()