Q. What are URL escape codes?
A. Some characters are not safe to use in a URL without
first being encoded. The most common URL escape code is %20, which
represents a space. See below for additional URL encoding examples.
Not your typical Links- URL Encoding
Author: Colm
Gallagher
Author's Site: ColmGallagher.com
URL Escape codes
Common characters that may need to be encoded
to stop browsers from choking
Some characters are not safe to use in a URL without first being
encoded. These include special and reserved characters which may
have a special meaning within a URL. In order that these characters
are interpreted correctly, their encoded equivalent should be used.
How is the encoded value determined?
Each character has a corresponding decimal value in the ASCII character
set. The encoding is done by taking the value, converting it to
a hexadecimal value and preceding that with a "%".
Example: The ASCII value of a # is 35.
Converted to hex it becomes 23. So the encoding value becomes %23
Here are some more characters that should be encoded if they are
to be included in a URL. ...........Thanks turtle
(Mike)!
%20 is a space,
%0A is a line feed,
%0D is a carriage return,
%3A is a : (colon)
%3B is a ; (semi-colon)
%2F is a / (forward slash)
%5C is a \ (backslash)
%21 is a ! (exclamation)
%22 is a " (inverted comma)
%23 is a # (hash)
%3F is a ? (question mark)
%3D is a = (equals)
%40 is a @ (at)
%25 is a % (percentage)
%3E is a > (greater than)
%3C is a < (less than)
%24 is a $ (dollar)
%26 is a & (ampersand)
%5B is a [
%5D is a ]
%7E is a ~ (tilde)
%5E is a ^
%60 is a `
%7B is a { (opening bracket)
%7D is a } (closing bracket)
%7C is a | (pipe)
The Examples
Note: This should all be on one line in the HTML
code.
EXAMPLE:
Say you want to include a URL in a mailto URL.
mailto:me@quaffer.net?subject=How%20are%20you%3F&
body=Look%20at%20this%20site%20%0ahttp%3a%2f%2fwww.colmgallagher.com
Try
it!
EXAMPLE:
mailto:me@quaffer.net?subject=How%20are%20You&cc=metoo@quaffer.net&
bcc=measwell@quaffer.net&body=Just saying hello!
Try
it!
Related Tutorials
Not your typlical links-Mailto, Telnet &
News
by Colm Gallagher
URL: http://www.dwfaq.com/Miscellaneous/special_links.asp
|