Percent-encode everything that isn't safe to have in a path without encoding safe chars.
Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
Percent-encode everything that isn't safe to have in a path without encoding safe chars.
Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3: