Hosting Geared For
your CMSMS needs
Hosting Starting at $15
- • Hosted Mail
- • Personal Control Panel
- • CMSMS 1.8.1 tested
- • Lightly packed servers
- • Intrusion Detection
- • URL monitored
- • Custom solutions available
CP Blogs
'What are those "%20"?
Posted by: Jeremy Bass
on May 24, 2009
Category:
HTML, Presentation, Basics, Coding, SEO
Summary:
The specification for URLs (RFC 1738, Dec. '94) poses a problem, in that it limits the use of allowed characters in URLs to only a limited subset of the US-ASCII character set...
RFC 1738: Uniform Resource Locators (URL) specification
The specification for URLs (RFC 1738, Dec. '94) poses a problem, in that it limits the use of allowed characters in URLs to only a limited subset of the US-ASCII character set...
Ad Space
'What are those "%20"?
RFC 1738: Uniform Resource Locators (URL) specificationThe specification for URLs (RFC 1738, Dec. '94) poses a problem, in that it limits the use of allowed characters in URLs to only a limited subset of the US-ASCII character set:
"...Only alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()," [not including the quotes - ed], and reserved characters used for their reserved purposes may be used unencoded within a URL."HTML, on the other hand, allows the entire range of the ISO-8859-1 (ISO-Latin) character set to be used in documents - and HTML4 expands the allowable range to include all of the Unicode character set as well. In the case of non-ISO-8859-1 characters (characters above FF hex/255 decimal in the Unicode set), they just can not be used in URLs, because there is no safe way to specify character set information in the URL content yet [RFC2396.]
URLs should be encoded everywhere in an HTML document that a URL is referenced to import an object (A, APPLET, AREA, BASE, BGSOUND, BODY, EMBED, FORM, FRAME, IFRAME, ILAYER, IMG, ISINDEX, INPUT, LAYER, LINK, OBJECT, SCRIPT, SOUND, TABLE, TD, TH, and TR elements.)
What characters need to be encoded and why?
| ASCII Control characters | ||
| Why: | These characters are not printable. | |
| Characters: | Includes the ISO-8859-1 (ISO-Latin) character ranges 00-1F hex (0-31 decimal) and 7F (127 decimal.) | |
| Non-ASCII characters | ||
| Why: | These are by definition not legal in URLs since they are not in the ASCII set. | |
| Characters: | Includes the entire "top half" of the ISO-Latin set 80-FF hex (128-255 decimal.) | |
| "Reserved characters" | |||||||
| Why: | URLs use some characters for special use in defining their syntax. When these characters are not used in their special role inside a URL, they need to be encoded. | ||||||
| Characters: |
|
||||||
| "Unsafe characters" | |||||||||||||||||||||||||
| Why: | Some characters present the possibility of being misunderstood within URLs for various reasons. These characters should also always be encoded. | ||||||||||||||||||||||||
| Characters: |
|
||||||||||||||||||||||||
How are characters URL encoded?
URL encoding of a character consists of a "%" symbol, followed by the two-digit hexadecimal representation (case-insensitive) of the ISO-Latin code point for the character.
- Example
-
- Space = decimal code point 32 in the ISO-Latin set.
- 32 decimal = 20 in hexadecimal
- The URL encoded representation will be "%20"
Ad Space

Get Social With It
[+]Add A Comment
[+]