What is URL Encoding (Percent-Encoding)?
The architecture of the internet requires Uniform Resource Locators (URLs) to be transmitted over HTTP using the standard US-ASCII character set. If a URL contains characters outside of this strict alphabet—such as spaces, emojis, or Cyrillic text—the web browser or server will crash or misinterpret the route.
To safely transmit complex data in a URL query string, we must apply URL Encoding (often called percent-encoding). This algorithm converts unsafe characters into a % symbol followed by a hexadecimal representation of the character's ASCII/UTF-8 value.
For example, a standard space character becomes %20, and an ampersand (&) becomes %26. This guarantees the data reaches the backend server perfectly intact.