1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Percent-encoding and percent-decoding helpers for URI components.
//!
//! Follows RFC 3986 for unreserved character set in encoding.
//! Decoding is lenient: invalid/incomplete sequences are left as-is.
/// Percent-encode a string for URI components (userinfo, etc.).
///
/// Encodes all bytes that are not in the unreserved set (RFC 3986 ยง2.3):
/// `ALPHA / DIGIT / "-" / "." / "_" / "~"`.
/// Percent-decode a string (e.g. `%20` โ space, `%E6%96%87` โ ๆ).
///
/// Invalid/incomplete percent sequences are left as-is.