Function ToUnicode(ByVal str)
Dim s
For i = 1 To Len(str)
B=Mid(str, i, 1)
ub = AscW(B)
If ub<0 Then
s=s& "&#" & CStr((ub+65536)) &";"
ElseIf ub <128 Then
s=s & b
Else
s=s & "&#" & CStr((ub)) &";"
End If
Next
ToUnicode=s
End Function