About URL Encoding & Decoding
URL encoding, also known as Percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. It is mainly used to represent characters that are not allowed or have special meaning within URLs (such as spaces, question marks, and ampersands) by replacing them with a percentage sign followed by two hexadecimal digits.
Why do URLs need encoding?
URLs can only contain characters from the standard US-ASCII character set. Characters outside this set (like emoji, Chinese/Japanese characters) or special control characters within URLs must be escaped so that web servers and browsers can parse and transmit the request reliably without ambiguity.