$ perl use CGI; use URI::Escape; my $orig = q{a9: _-;&'"}; printf "HTML escaped: %s\n", CGI->escapeHTML($orig); printf "URL escaped: %s\n", uri_escape($orig); ^D HTML escaped: a9: _-;&<tag>'" URL escaped: a9%3A%20_-%3B%26%3Ctag%3E'%22 #### 2.4.3. Excluded US-ASCII Characters Although they are disallowed within the URI syntax, we include here a description of those US-ASCII characters that have been excluded and the reasons for their exclusion. The space character is excluded because significant spaces may disappear and insignificant spaces may be introduced when URI are transcribed or typeset or subjected to the treatment of word- processing programs. Whitespace is also used to delimit URI in many contexts. space = Data corresponding to excluded characters must be escaped in order to be properly represented within a URI. #### unescaped space escaped space entity amp url-escaped amp