How URL Encoding Works
URL encoding replaces unsafe characters with %XX where XX is the two-digit hexadecimal byte value. Reserved characters that have special meaning in URLs (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) are encoded when they appear inside a path segment or query value. Unreserved characters (A-Z a-z 0-9 - _ . ~) are always passed through unchanged. For non-ASCII text, the string is first encoded to UTF-8 bytes, then each byte is percent-escaped.