This section discusses the characters to use or avoid in URLs.
Standard Characters
The URL formatting must adhere to the standards published in the Internet Engineering Task Force (IETF) RFC 1738. Use of non-standard characters in URLs results in unreliable browser performance including the browser not locating the specified web page.
Spaces and Commas
If you use spaces or commas, convert them to their ASCII equivalent. URL encoding consists of a percent (%) symbol followed by the two-digit hexadecimal representation (case-insensitive) of the ISO-Latin code point for the character.
Note: Some browsers encounter problems processing URLs even with this encoding.
Ampersands
If you use ampersands, convert them to &.
CDATA
You can put URLs inside a CDATA section so that they are not parsed, which avoids possible problems with URLs and the XML parser.
Comply with the CDATA requirements, including the following:
Unsafe Characters
The following table lists characters that are easily misinterpreted in URLs. Always substitute these characters with % followed by the hexadecimal code points listed in the table. For example, use %20 to represent a space in a URL.
|
Character |
Code Points (Hex) |
|---|---|
|
Space |
20 |
|
Quotation marks (") |
22 |
|
Less Than symbol (<) |
3C |
|
Greater Than symbol (>) |
3E |
|
Pound character (#) |
23 |
|
Percent symbol (%) |
25 |
|
Left Curly Brace ({) |
7B |
|
Right Curly Brace (}) |
7D |
|
Vertical Bar/Pipe (|) |
7C |
|
Backslash (\) |
5C |
|
Caret (^) |
5E |
|
Tilde (~) |
7E |
|
Left Square Bracket ([) |
5B |
|
Right Square Bracket (]) |
5D |
|
Grave Accent (`) |
60 |
Reserved Characters
The following table lists characters that have special uses in URLs. Substitute such characters with % followed by the hexadecimal code points listed in the table when they are used as regular text and not in their special role. For example, use %24 to represent a plain-text dollar sign ($) in a URL.
|
Character |
Code Points (Hex) |
|---|---|
|
Dollar ($) |
24 |
|
Ampersand (&) |
26 (or "&" as explained earlier) |
|
Plus (+) |
2B |
|
Comma (,) |
2C |
|
Forward slash/Virgule (/) |
2F |
|
Colon (:) |
3A |
|
Semi-colon (;) |
3B |
|
Equals (=) |
3D |
|
Question mark (?) |
3F |
|
At symbol (@) |
40 |
|
Copyright © 2013 CA.
All rights reserved.
|
|