Escape does not encode characters with 69: *,+,-,.,/,@,_,0-9,a-z,a-z
encodeURI does not encode 82 characters:!,#,$,&, ', (,), *,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,a-z
encodeURIComponent does not encode 71 characters:!, ', (,), *,-,.,_,~,0-9,a-z,a-z
1.
JS: escape:
- JS can use escape when using data
- For example: Search the history record of the Tibetan.
- Unicode values other than 0-255 are encoded with the output%u**** format, and in other cases the Escape,encodeuri,encodeuricomponent encoding results are the same.
Decoding using: unescape
C#:
Httputility.urlencode
Httputility.urldecode
2.
JS: encodeURI:
- encodeURI can be used as a whole when making URL jumps
- For example: Location.href=encodeuri ("http://cang.baidu.com/do/s?word= Baidu &ct=21");
Decode using decodeURI ();
C #: decodeuricomponent
3.
JS: encodeuricomponent:
- You need to use encodeURIComponent when passing parameters so that the combined URLs are not truncated by special characters such as #.
- For example: <script language= "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
About URL pass-through value garbled