Function FilterUnicode2UTF_8(ByRef strUnicode)
dim i,strMid,strStream,ascWord
'strUnicode=Replace(strUnicode,vbCrLf,"")
for i=1 to len(strUnicode)
strMid=Mid(strUnicode,i,1)
ascWord=Asc(strMid)
if (ascWord<0 or ascWord>127) then
strStream=strStream+"&#x"+FormatHex4(ascW(strMid))+";"
else
strStream=strStream+strMid
end if
next
FilterUnicode2UTF_8=strStream
End Function
Function FormatHex2(num)
num=num and &HFF
if num<16 then
FormatHex2="0"+Hex(num)
else
FormatHex2=Hex(num)
end if
End Function
Function FormatHex4(num)
dim high,low
high=(num and &HFF00)\&H100
low=num and &HFF
FormatHex4=FormatHex2(high)&FormatHex2(low)
End Function