Encode mode
Replaces every character outside the unreserved set [A-Za-z0-9-_.~] with its %XX hex equivalent. Equivalent to JavaScript's encodeURIComponent, Python's urllib.parse.quote (with safe=''), and the standard URL-encoding behaviour of most HTTP libraries.