Percent-encoding - MDN Web Docs Glossary: Definitions of Web-related terms 编辑
Percent-encoding is a mechanism to encode 8-bit characters that have specific meaning in the context of URLs. It is sometimes called URL encoding. The encoding consists of substitution: A '%' followed by the hexadecimal representation of the ASCII value of the replace character.
Special characters needing encoding are: ':'
, '/'
, '?'
, '#'
, '['
, ']'
, '@'
, '!'
, '$'
, '&'
, "'"
, '('
, ')'
, '*'
, '+'
, ','
, ';'
, '='
, as well as '%'
itself. Other characters don't need to be encoded, though they could.
':' | '/' | '?' | '#' | '[' | ']' | '@' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '%' | ' ' |
%3A | %2F | %3F | %23 | %5B | %5D | %40 | %21 | %24 | %26 | %27 | %28 | %29 | %2A | %2B | %2C | %3B | %3D | %25 | %20 or + |
Depending on the context, the character ' '
is translated to a '+'
(like in the percent-encoding version used in an application/x-www-form-urlencoded
message), or in '%20'
like on URLs.
Learn more
General knowledge
- Definition of percent-encoding in Wikipedia.
Technical knowledge
- RFC 3986, section 2.1, where this encoding is defined.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论