Home > Article > Web Front-end > Organize the URL encoding and character encoding supported in HTML5_html5 tutorial skills
URL encoding
URL encoding is to convert unprintable characters or characters with special meaning in URLs into a representation that is understood and generally accepted by web browsers and servers. These characters include:
ASCII control characters - Unprintable characters often used for output control. The character range is 00-1F hexadecimal (0-31 decimal) and 7F (127 decimal). A complete coding sheet is provided below.
Non-ASCII control characters - These characters are outside the range of the 128-bit ASCII character set. This range is part of the ISO-Latin character set and the "first half" of the ISO-Latin character set containing the entire hexadecimal 00-FF (decimal 128-255) range. A complete coding sheet is provided below.
Reserved characters - symbols such as dollar sign, ampersand, plus sign, universal sign, forward slash, colon, separator, equal sign, question mark, and "at". All these symbols have different meanings within the URL and therefore require encoding. A complete coding sheet is provided below.
Unsafe characters - including space, question mark, less than sign, greater than sign, pound character, percent sign, left part of curly brace, right part of curly brace, pipe character, backslash, caret, tilde. Left square bracket, right square bracket, grave accent. For some reason, these characters present in URLs have the potential to be misinterpreted. These characters should always be encoded as well. A complete coding sheet is provided below. The
encoding representation requires three characters to replace the expected character: a percent sign, two hexadecimal digits indicating the character position in the ASCII character set,
Example
One of the most common special characters is the space. We cannot directly enter a space in the URL. A space is equal to 20 in hexadecimal in the character set. Therefore, you can use to represent spaces when requesting the server.
ASCII control character encoding
includes hexadecimal 00-1F (decimal 0-31) and 7F (decimal 127) character codes.
十进制格式 | 十六进制值 | 字符 | URL 编码 |
---|---|---|---|
0 | 00 |