URIs use percent encoding to represent characters which would otherwise be reserved (like the forward slash - %2F
), not always displayable or recognizable (Unicode characters, e.g. non-Latin letters) or otherwise inconvenient (like the space character - %20
).
RFC 1630 says
The choice of escape character for introducing representations of non-allowed characters also tends to be a matter of taste. An ANSI standard exists in the C language, using the back-slash character "\". The use of this character on unix command lines, however, can be a problem as it is interpreted by many shell programs, and would have itself to be escaped. It is also a character which is not available on certain keyboards. The equals sign is commonly used in the encoding of names having attribute=value pairs. The percent sign was eventually chosen as a suitable escape character.
Is there any reason that the percent sign was chosen, rather than, say, $
, ^
or *
, all of which (AFAIK) don't have a special function in URIs?
$
and*
are also interpreted in many shell programs, and^
may not have been available on some keyboards.