Http://www.jb51.net/article/14657.htm JS has 3 functions for text encoding: escape,encodeuri,encodeuricomponent, corresponding decoding function: Unescape, Decodeuri,decodeuricomponent 1, escape to encode characters other than ANSI code 0-255 output%u**** format is the Unicode value, the Escape method returns a string value (in Unicode format) that contains the contents of the charstring. All spaces, punctuation, accent marks, and other non-ASCII characters are replaced with%XX encoding, where xx equals the hexadecimal number that represents the character. For example, a space returns "%20"
Escape does not encode characters with 69: *,+,-,.,/,@,_,0-9,a-z,a-z
2. encodeURI similar to escape for address bar coding
encodeURI does not encode 82 characters:!,#,$,&, ', (,), *,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,a-z
3, encodeURIComponent for address bar coding. Encodes a text string as a valid component of a Uniform Resource Identifier (URI). It is the Chinese, Korean and other special characters into the utf-8 format of the URL encoding, if your page encoding is gb2312, the server side will be garbled.
encodeURIComponent does not encode 71 characters:!, ', (,), *,-,.,_,~,0-9,a-z,a-z
So JS using the data can use escape, for the address bar data, it is best to use encodeuricomponent encoding.do not understand the function can be searched!
The difference analysis of JS character coding function