日期:2014-05-18 浏览次数:20669 次
public static string FullHTMLEncode(string inputVal)
{
if (inputVal != null)
{
inputVal = inputVal.Replace(">", ">");
inputVal = inputVal.Replace("<", "<");
inputVal = inputVal.Replace("\'", "'");
inputVal = inputVal.Replace("\"", """);
inputVal = inputVal.Replace(string.Format("{0}", (char)32), " ");
inputVal = inputVal.Replace(string.Format("{0}", (char)9), " ");
inputVal = inputVal.Replace(string.Format("{0}", (char)34), """);
inputVal = inputVal.Replace(string.Format("{0}", (char)39), "'");
inputVal = inputVal.Replace(string.Format("{0}", (char)13), "");
}
return inputVal;
}
------解决方案--------------------
解决方法,节点内容编码。
1)base64编码形式存放
2)html代码转成unicode编码存放(这个说明可能有误)
这个的转码函数的vbs写法是
Function uni(Chinese)
dim j,a
For j = 1 to Len (Chinese)
a=Mid(Chinese, j, 1)
uni= uni & "&#x" & Hex(Ascw(a)) & ";"
next
End Function