Revision as of 21:36, 1 December 2005 editTizio (talk | contribs)Extended confirmed users13,761 edits →The application/x-www-form-urlencoded type: not necessarily← Previous edit | Revision as of 23:16, 1 December 2005 edit undoTizio (talk | contribs)Extended confirmed users13,761 edits MIME type - a slightly longer explanationNext edit → | ||
Line 14: | Line 14: | ||
| <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> | | <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> | ||
|- | |- | ||
| <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> | | <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>[[4�� @���4schemes. | ||
| <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> | |||
|} | |||
{| border="1" cellpadding="5px" | |||
|+Reserved characters, per <nowiki>RFC 3986</nowiki> (January 2005) | |||
|- | |||
| <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]</code> || <code>]]</code> | |||
|} | |||
No other characters are allowed in a URI. | |||
=== Percent-encoding reserved characters === | |||
When a character from the reserved set (a "reserved character") has special meaning (a "reserved purpose") in a certain context, and a URI scheme says that is necessary to use that character for some ''other'' purpose, then the character must be ''percent-encoded''. Percent-encoding a reserved character involves converting the character to its corresponding value in ] and then representing that value as a pair of ] digits. The digits, preceded by a percent sign ("<code>%</code>"), are then used in the URI in place of the reserved character. | |||
For example, the reserved character "<code>/<code>", if used in the "path" component of a URI, has the special meaning of being a delimiter ''between'' path segments. If, according to a given URI scheme, "<code>/</code>" needs to be ''in'' a path segment, then the three characters "<code>%2F</code>" or "<code>%2f</code>" must be used in the segment instead of a raw "<code>/</code>". | |||
Reserved characters that have no reserved purpose in a particular context may also be percent-encoded, but are not semantically different from those that are not percent-encoded. | |||
For example, in the "query" component of a URI, "<code>/</code>" is still considered a reserved character, but it normally has no reserved purpose, unless a particular URI scheme says otherwise. When it has no reserved purpose, the character does not need to be percent-encoded. | |||
URIs that differ only by the percent-encoding of reserved characters are not normally considered equivalent (denoting the same resource), unless it can be determined that the reserved characters in question have no reserved purpose. This determination is dependent upon the rules established for reserved characters by individual URI schemes. | |||
=== Percent-encoding unreserved characters === | === Percent-encoding unreserved characters === | ||
Line 66: | Line 44: | ||
==The application/x-www-form-urlencoded type== | ==The application/x-www-form-urlencoded type== | ||
When Web forms are submitted, their content is encoded and sent to the server. The encoding used by default is based on percent encoding (see ]). The ] of form contents when encoded this way is <code>application/x-www-form-urlencoded</code>. This type name is included in some form with the transmitted data when forms are submitted via HTTP POST or via ]. | |||
<code>application/x-www-form-urlencoded</code> is the ] type for the content of Web forms when they are encoded as percent-encoded ]s. | |||
{{sectstub}} | {{sectstub}} | ||
<!-- this MIME type appears to be non-standard; which browser supports it? --> | |||
<!-- discuss this media type, including how it is underspecified and outdated, how it differs from current standards, and how it has been implemented in web browsers for submitting HTML form data using the encoding of the HTML document containing the form (or user override) as the basis for percent-encoding, and workarounds used for unencodable characters --> | <!-- discuss this media type, including how it is underspecified and outdated, how it differs from current standards, and how it has been implemented in web browsers for submitting HTML form data using the encoding of the HTML document containing the form (or user override) as the basis for percent-encoding, and workarounds used for unencodable characters --> | ||
Revision as of 23:16, 1 December 2005
Percent-encoding, also known as URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier under certain circumstances. It is also used in the preparation of data of the "application/x-www-form-urlencoded" media type, as is often used in email messages and the submission of HTML form data.
Percent-encoding in a URI
Types of URI characters
The characters in a URI, regardless of how they might be encoded, are taken from a set of unreserved characters for general use, and a smaller set of reserved characters that sometimes have special meaning in certain contexts. These sets and the circumstances under which certain characters from the reserved set have special meaning have changed slightly with each revision of specifications that govern URIs and URI schemes.
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z
|
a |
b |
c |
d |
e |
f |
g |
h |
i |
j |
k |
l |
m |
n |
o |
p |
q |
r |
s |
t |
u |
v |
w |
x |
y |
z
|
0 |
1 |
2 |
3 |
[[4�� @���4schemes.
|