復(fù)制代碼 代碼如下:
function HTMLEncode(fString)
fString=Replace(fString,";","#59;")
fString=Replace(fString,"","lt;")
fString=Replace(fString,">","gt;")
fString=Replace(fString,"\","#92;")
fString=Replace(fString,"--","#45;#45;")
fString=Replace(fString,CHR(9),"#9;")
fString=Replace(fString,CHR(10),"br>")
fString=Replace(fString,CHR(13),"")
fString=Replace(fString,CHR(22),"#22;")
fString=Replace(fString,CHR(32),"#32;")
fString=Replace(fString,CHR(34),"#34;")'雙引號(hào)
fString=Replace(fString,CHR(39),"#39;")'單引號(hào)
fString=ReplaceText(fString,"#([0-9]*)#59;","#$1;") '解決韓文字符問題
if IsSqlDataBase=0 then '過濾片假名(日文字符)[\u30A0-\u30FF] by yuzi首創(chuàng)
fString=escape(fString)
fString=ReplaceText(fString,"%u30([A-F][0-F])","#x30$1;")
fString=unescape(fString)
end if
HTMLEncode=fString
end function