我的页面上我已经设置了UTF-8编码。然后,我发送encodeURIComponent()函数编码的字符串“ły
”到%C5%82y
并在服务器端,我得到%25C5%2582y
。现在我想回到原来的字符串。C#如何从UTF-8字符串中检索原始字符串?
我已经试过:
HttpUtility.HtmlDecode(): the result is %25C5%2582y
Uri.UnescapeDataString(): the result is %C5%82y
我现在很困惑 - 如何检索回原始字符串?
如何从encodeURIComponent中获得#C5y#82y? – deceze
我认为这是你在找什么: http://stackoverflow.com/questions/86477/does-c-sharp-have-an-equivalent-to-javascripts-encodeuricomponent –
这看起来像一个双 - 编码,其中'%C5'中的'%'编码为'%25'。 – wberry