This article is mainly on the JS and C # encoding and decoding a detailed introduction, the need for friends can come to the reference, I hope to help you.
Escape does not encode characters there are 69: *,+,-,.,/,@,_,0-9,a-z,a-z encodeURI not encoded characters have 82:!,#,$,&, ', (,), *,+,,,-,.,/,:,;,=,?,@,_,~, 0-9,a-z,a-z encodeURIComponent have 71 characters not encoded:!, ', (,), *,-,.,_,~,0-9,a-z,a-z 1. Js:escape: JS use data can use escape , for example: Search the history record in the Tibetan. Unicode values other than 0-255 are encoded with the output%u**** format, and the Escape,encodeuri,encodeuricomponent encoding results are the same in other cases. Decoding use: unescape C #: httputility.urlencode Httputility.urldecode 2. Js:encodeuri: URL jump can be used as a whole encodeURI For example: Location.href=encodeuri ("http:// cang.baidu.com/do/s?word= Baidu &ct=21 "); decoding using decodeURI (); C #: decodeURIComponent 3. js:encodeuricomponent: Pass parameters need to use encodeuricomponent, so that the combination of URLs will not be # and other special characters truncated. For example: <script Lang uage= "JavaScript" >document.write (' <a href= ' http://passport.baidu.com/?logout&aid=7& u= ' +encodeuricomponent ("http://cang.baidu.com/bruce42") + ' "> Exit </a& gt; '); </script> decoding using decodeuricomponent () C #: [HttpContext.Current.] Server.urldecode [HttpContext.Current.] server.urlencode