Thursday, September 18, 2008

TransferCode - ASCII To Unicode

TransferCode - ASCII To Unicode





'Chg_UNI(字串)

Function Chg_UNI() Chg_UNI(str)
dim old,new_w,iStr
old = str
new_w = ""
for iStr = 1 to len(str)
if ascw(mid(old,iStr,1)) < 0 then
new_w = new_w & "&#" & ascw(mid(old,iStr,1))+65536 & ";"
elseif ascw(mid(old,iStr,1))>0 and ascw(mid(old,iStr,1))<127 then
new_w = new_w & mid(old,iStr,1)
else
new_w = new_w & "&#" & ascw(mid(old,iStr,1)) & ";"
end if
next
Chg_UNI=new_w
End Function

No comments: