Function chBytes2BSTR(vIn) strReturn = "" For vb_i_vb__ = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,vb_i_vb__,1)) If ThisCharCode < &H80 Then strReturn = strReturn & Chr(ThisCharCode) Else NextCharCode = AscB(MidB(vIn,vb_i_vb__+1,1)) strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode)) vb_i_vb__ = vb_i_vb__ + 1 End If Next chBytes2BSTR = strReturn End Function Function chURLEncode(vstrIn) strReturn = "" For vb_i_vb__ = 1 To LenB(vstrIn) ThisCharCode = MidB(vStrIn, vb_i_vb__, 1) If Abs(AscB(ThisCharCode)) < &HFF Then strReturn = strReturn & ThisCharCode Else innerCode = AscB(ThisCharCode) If innerCode < 0 Then innerCode = innerCode + &H10000 End If Hight8 = (innerCode And &HFF00)\ &HFF Low8 = innerCode And &HFF strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8) End If Next chURLEncode = strReturn End Function Function chAscHex(Str) chAscHex = hex(asc(str)) End Function Function URLEncoding(vstrIn) dim strReturn, i,ThisChr,AscChr strReturn = "" For i = 1 To Len(vstrIn) ThisChr = Mid(vStrIn,i,1) AscChr = Asc(ThisChr) If Abs(AscChr) < &HFF Then If Abs(AscChr) >= &H20 Then strReturn = strReturn & Chr(AscChr) ElseIf AscChr=9 Or AscChr=10 Or AscChr=13 Then strReturn = strReturn & "%0" & Hex(AscChr) Else strReturn = strReturn & " " End If Else innerCode = AscChr If innerCode < 0 Then innerCode = innerCode + &H10000 End If Hight8 = (innerCode And &HFF00)\ &HFF Low8 = innerCode And &HFF strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8) End If Next URLEncoding = strReturn End Function