我有一个表示HTML块的字符串。所有unicode字符都被编码。因此在插入数据库时需要很多空间。
例如:<p>thích</p>
保存为<p>thích</p>
如何解码那些unicode字符?我不能使用HttpUtility.HtmlDecode,因为它会解码一些其他字符,如&gt;或者&lt;同样,我仍然希望它被编码。
答案 0 :(得分:0)
如何手动重新编码非unicode特定字符?
Server.HtmlDecode(str).Replace("<","<")
.Replace(">",">")
.Replace("&","&")
.Replace("\"",""")
.Replace("\'","'")