Decode unicode chracters in HTML in ASP.NET
I have a string that represents an HTML block. All the unicode characters are encoded. So it takes lots of spaces when inserted to database.
For example: <p>thích</p>
is saved as <p>thích</p>
How can I decode those unicode 开发者_JAVA百科characters? I cannot use HttpUtility.HtmlDecode because it will decode some other characters like > or < as well, which I still want it to be encoded.
What about just manually re-encoding the non-unicode specific characters?
Server.HtmlDecode(str).Replace("<","<")
.Replace(">",">")
.Replace("&","&")
.Replace("\"",""")
.Replace("\'","'")
精彩评论