Pages

Monday, August 6, 2007

String to UCS-2 Convert

Function Convert(Word)
For i = 1 to Len(Word)
IF Asc(Mid(Word,i,1)) > 0 and Asc(Mid(Word,i,1)) < 256 THEN
CVT = "00" & Hex(Asc(Mid(Word,i,1))) 'Convert AlphaNumeric
ELSE
CVT = Replace(Escape(Mid(Word,i,1)),"%u", "") 'Convert Chinese Character
END IF

TMsg = TMsg & CVT
Next
Convert = TMsg
END Function

No comments:

Post a Comment