How do I decode HTML that was encoded in JS using encodeURIComponent()?

后端 未结 2 809
無奈伤痛
無奈伤痛 2020-12-29 03:09

I tried :

string decodedHtml = HttpUtility.HtmlDecode(html);

Where html is the encoded html. It seems that this does not alter the string a

相关标签:
2条回答
  • 2020-12-29 03:40

    Think you can use this code.

    HttpContext.Current.Server.UrlDecode(html)
    
    0 讨论(0)
  • 2020-12-29 03:53
    string s = System.Uri.UnescapeDataString(html);
    
    0 讨论(0)
提交回复
热议问题