HTML and CSS Reference
If you need to use a character in a URL that is not part of this character
set, you must encode the character using a special notation. The en-
coding notation replaces the desired character with three characters: a
percent sign and two hexadecimal digits whose values correspond to the
position of the character in the ASCII character set.
This is easier than it sounds. One of the most common special char-
acters is the space (owners of older Macintoshes, take special notice),
whose position in the character set is 20 hexadecimal. [*] You can't type
a space in a URL (well, you can, but it won't work). Rather, replace
spaces in the URL with %20 :
[*] Hexadecimal numbering is based on 16 characters: 0 through 9 followed by A through F, which in
decimal are equivalent to values 0 through 15. Also, letter case for these extended values is not signi-
ficant; "a" (10 decimal) is the same as "A," for example.
This URL actually retrieves a document named new pricing.html from
the www.kumquat.com server.
22.214.171.124. Handling reserved and unsafe characters
In addition to the nonprinting characters, you'll need to encode reserved
and unsafe characters in your URLs as well.
Reserved characters are those that have a specific meaning within the
URL itself. For example, the slash character separates elements of a
pathname within a URL. If you need to include in a URL a slash that is
not intended to be an element separator, you'll need to encode it as %2F :