字符url编码
A URL is an address for a website. Just like postal addresses have to follow a specific format to be understood by the postman, URLS have to follow a format to be understood and get you to the right location.
URL是网站的地址。 就像邮政地址必须遵循邮递员可以理解的特定格式一样,URLS也必须遵循可以理解的格式并将您带到正确的位置。
There are only certain characters that are allowed in the URL string, alphabetic characters, numerals, and a few characters ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #
that can have special meanings.
URL字符串中仅允许使用某些字符,字母字符,数字和一些字符; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #
; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #
; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #
可能有特殊含义。
保留字符 (Reserved Characters)
编码方式 (Encoding)
Any character that is not an alphabetic character, a number, or a reserved character being used needs to be encoded.
任何非字母字符,数字或正在使用的保留字符的字符都需要进行编码。
URLs use the ASCII (“American Standard Code for Information Interchange”) character-set and so encoding must be to a valid ASCII format.
URL使用ASCII(“美国信息交换标准代码”)字符集,因此编码必须为有效的ASCII格式。
There are functions in most web languages to do this encoding for you, for example in JavaScript encodeURI()
and in PHP rawurlencode()
.
大多数网络语言中都有一些函数可以为您执行此编码,例如,在JavaScript encodeURI()
和PHP rawurlencode()
。
例: (Example:)
encodeURI(Free Code Camp);
// Free%20Code%20Camp
翻译自: https://www.freecodecamp.org/news/url-encoded-characters-reference/
字符url编码