JS and C # coded decoding

Source: Internet
Author: User
Tags httpcontext urlencode

  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     
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.