Chapter 3
URL Encoding
Section 5
How Does URL Encoding Work?
URLs have to abide by certain rules, and these rules say that a URL needs to be composed from a limited set of characters belonging to the US-ASCII character set. These characters include digits (0-9), letters (A-Z, a-z), and a few special characters (“-â€, “.â€, “_â€, “~â€). This means that any weird characters (such as backspace, vertical tab, horizontal tab, line feed), unsafe characters (such as space, \, <, >, {, }), and any character outside the ASCII charset is not allowed to be placed directly within URLs. So, what do we do when we need to transmit any data in the URL that contains these disallowed characters? Well, we encode them!