如何解码WCF页面中的字符串 [英] How to decode string in WCF pages

查看:80
本文介绍了如何解码WCF页面中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解码WCF页面或使用''escape()'在Jquery中编码的Web服务页面中的字符串,编码的字符串采用这种格式''Manual%20Analysis''

它应该被解码为WCF页面中的手动分析。编码可能会有所不同。



How to Decode a string in WCF page or web service page which has been encoded in Jquery using ''escape()'' , the encoded string is in this format ''Manual%20Analysis''
it should be decoded to ''Manual analysis'' in WCF page. the encoding may vary.

prefixText = escape(prefixText);

推荐答案

检查哪一个给你最好的结果

check which one gives you the best results
HttpUtility.UrlDecode(encodedString, System.Text.Encoding.Default);




System.Uri.UnescapeDataString(encodedString);





URL解码为某些字符提供不正确的解码(例如+)



那里是HttpUtility中另一个名为HtmlDecode的方法,检查哪一个最适合你。



URL decode gives incorrect decoding for some characters (like for "+")

there is one more method named HtmlDecode in HttpUtility, check which one suits you best.


检查哪一个给你最好的结果

check which one gives you the best results
HttpUtility.UrlDecode(encodedString, System.Text.Encoding.Default);




System.Uri.UnescapeDataString(encodedString);





URL解码为某些字符提供不正确的解码(例如+)



ther e是HttpUtility中另一个名为HtmlDecode的方法,检查哪一个最适合你。



URL decode gives incorrect decoding for some characters (like for "+")

there is one more method named HtmlDecode in HttpUtility, check which one suits you best.


这篇关于如何解码WCF页面中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆