HTML BASIC
HTML Introduction
HTML Getting Started
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Links
HTML Text Formatting
HTML Styles
HTML Images
HTML Tables
HTML Lists
HTML Forms
HTML Iframes
HTML ADVANCED
HTML Doctypes
HTML Layout
HTML Head
HTML Meta
HTML Scripts
HTML Entities
HTML URL
HTML URL Encode
HTML Validation
HTML5 FEATURES
HTML5 New Input Types
HTML5 Canvas
HTML5 SVG
HTML5 Audio
HTML5 Video
HTML5 Web Storage
HTML5 Application Cache
HTML5 Web Workers
HTML5 SSE
HTML5 Geolocation
HTML5 Drag & Drop
HTML URL Encode - Html5 基础教程 - IT书包
网站首页
HTML URL Encode
### What is URL Encoding According to RFC 3986, the characters in a URL only limited to a defined set of reserved and unreserved US-ASCII characters. Any other characters are not allowed in a URL. But URL often contains characters outside the US-ASCII character set, so they must be converted to a valid US-ASCII format for worldwide interoperability. URL-encoding, also known as percent-encoding is a process of encoding URL information so that it can be safely transmitted over the internet. To map the wide range of characters that is used worldwide, a two-step process is used: - At first the data is encoded according to the UTF-8 character encoding. - Then only those bytes that do not correspond to characters in the unreserved set should be percent-encoded like %HH, where HH is the hexadecimal value of the byte. For example, the string: **François** would be encoded as: **Fran%C3%A7ois** Ç, ç (c-cedilla) is a Latin script letter. ### Reserved Characters Certain characters are reserved or restricted from use in a URL because they may (or may not) be defined as delimiters by the generic syntax in a particular URL scheme. For example, forward slash / characters are used to separate different parts of a URL. If data for a URL component contains character that would conflict with a reserved set of characters, which is defined as a delimiter in the URL scheme then the conflicting character must be percent-encoded before the URL is formed. Reserved characters in a URL are: <table class="data url-encoding"><tbody><tr><td><code>!</code></td><td><code>#</code></td><td><code>$</code></td><td><code>&</code></td><td><code>'</code></td><td><code>(</code></td><td><code>)</code></td><td><code>*</code></td><td><code>+</code></td><td><code>,</code></td><td><code>/</code></td><td><code>:</code></td><td><code>;</code></td><td><code>=</code></td><td><code>?</code></td><td><code>@</code></td><td><code>[</code></td><td><code class="plain">]</code></td></tr><tr><td><code>%21</code></td><td><code>%23</code></td><td><code>%24</code></td><td><code>%26</code></td><td><code>%27</code></td><td><code>%28</code></td><td><code>%29</code></td><td><code>%2A</code></td><td><code>%2B</code></td><td><code>%2C</code></td><td><code>%2F</code></td><td><code>%3A</code></td><td><code>%3B</code></td><td><code>%3D</code></td><td><code>%3F</code></td><td><code>%40</code></td><td><code>%5B</code></td><td><code class="plain">%5D</code></td></tr></tbody></table> ### Unreserved Characters Characters that are allowed in a URL but do not have a reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. The following table lists all the unreserved characters in a URL: <table class="data url-encoding"><tbody><tr><td><code>A</code></td><td><code>B</code></td><td><code>C</code></td><td><code>D</code></td><td><code>E</code></td><td><code>F</code></td><td><code>G</code></td><td><code>H</code></td><td><code>I</code></td><td><code>J</code></td><td><code>K</code></td><td><code>L</code></td><td><code>M</code></td><td><code>N</code></td><td><code>O</code></td><td><code>P</code></td><td><code>Q</code></td><td><code>R</code></td><td><code>S</code></td><td><code>T</code></td><td><code>U</code></td><td><code>V</code></td><td><code>W</code></td><td><code>X</code></td><td><code>Y</code></td><td><code class="plain">Z</code></td></tr><tr><td><code>a</code></td><td><code>b</code></td><td><code>c</code></td><td><code>d</code></td><td><code>e</code></td><td><code>f</code></td><td><code>g</code></td><td><code>h</code></td><td><code>i</code></td><td><code>j</code></td><td><code>k</code></td><td><code>l</code></td><td><code>m</code></td><td><code>n</code></td><td><code>o</code></td><td><code>p</code></td><td><code>q</code></td><td><code>r</code></td><td><code>s</code></td><td><code>t</code></td><td><code>u</code></td><td><code>v</code></td><td><code>w</code></td><td><code>x</code></td><td><code>y</code></td><td><code class="plain">z</code></td></tr><tr><td><code>0</code></td><td><code>1</code></td><td><code>2</code></td><td><code>3</code></td><td><code>4</code></td><td><code>5</code></td><td><code>6</code></td><td><code>7</code></td><td><code>8</code></td><td><code>9</code></td><td><code>-</code></td><td><code>_</code></td><td><code>.</code></td><td><code>~</code></td><td colspan="12"></td></tr></tbody></table> ### URL Encoding Converter The following converter encodes and decodes the characters according to RFC 3986. <iframe style="width:100%; height:160px; border:none;float:left" src="http://example.itshubao.com/inexample/425.html"></iframe> Enter some character and click on encode or decode button to see the output.
上一篇:
HTML URL
下一篇:
HTML Validation