การคัดลอกรหัสมีดังนี้:
'// แปลงภาษาจีนเป็น Unicode
functionurlencoding (vstrin)
Dimi
dimstrreturn, thischr, innercode, hight8, low8
strreturn = ""
fori = 1tolen (vstrin)
Thischr = mid (vstrin, i, 1)
ifabs (asc (thischr)) <& hffthen
strreturn = strreturn & thischr
อื่น
InnerCode = ASC (ThisChr)
ifinnerCode <0 แล้ว
InnerCode = InnerCode+& H10000
endif
Hight8 = (InnerCodeand & HFF00)/& HFF
low8 = innerCodeand & hff
strreturn = strreturn & "%" & hex (hight8) & "%" & hex (low8)
endif
ต่อไป
urlencoding = streturn
endfunction
'// แปลง Unicode เป็นข้อความปกติ
FunctionByTes2BSTR (VIN)
Dimi
dimstrreturn, thischode, nextcharcode
strreturn = ""
fori = 1tolenb (vin)
thischArcode = ascb (midb (vin, i, 1))
ifthisCharcode <& h80 จากนั้น
strreturn = Strreturn & Chr (ThisCharcode)
อื่น
NextCharcode = ASCB (MIDB (VIN, I+1,1)))
strreturn = strreturn & chr (clng (thischarcode)*& h100+cint (nextcharcode))
i = i+1
จุดสิ้นสุด
ต่อไป