Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
264 views
in Technique[技术] by (71.8m points)

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

I tried :

string decodedHtml = HttpUtility.HtmlDecode(html);

Where html is the encoded html. It seems that this does not alter the string at all. The html is still encoded.

question from:https://stackoverflow.com/questions/6022832/how-do-i-decode-html-that-was-encoded-in-js-using-encodeuricomponent

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
string s = System.Uri.UnescapeDataString(html);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...