开发者

encodeURIComponent in c sharp

开发者 https://www.devze.com 2023-04-08 01:25 出处:网络
I\'ve tried to use HttpUtility.UrlEncode in order to simulate the javscript\'s encodeURIComponent, but开发者_JS百科 had some issues (instead of getting \"%20\" i got \"+\")

I've tried to use HttpUtility.UrlEncode in order to simulate the javscript's encodeURIComponent, but开发者_JS百科 had some issues (instead of getting "%20" i got "+")

then I've replaced the string, but i see that the problem is not only in these two signs, in some places the encoded string (by UrlEncode) is totally different from the encoded string by using encodeURIComponent.

Any ideas how it can be solved ?

thanks.


You are looking for HttpUtility.UrlPathEncode.

See this SO question: Server.UrlEncode vs. HttpUtility.UrlEncode

0

精彩评论

暂无评论...
验证码 换一张
取 消