Search the site!Search DWfaq.com | Print This PagePrinter Friendly Page
Current: Default | Default: Vino

DreamweaverFAQ.com » Tutorials » Miscellaneous » Not Your Typical Links- Url Encoding

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

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.

Say you want to include a URL in a mailto URL.


Try it!


    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

::This page last modified 8/13/2013 at 04:37::

Copyright © 2001-2024 DreamweaverFAQ.com All Rights Reserved.
All brands, trademarks, tutorials, extensions, code, and articles are the property of their respective owners.
A production of Site Drive Inc.
Legal Notice | Privacy Policy | Disclaimer & Notice