CopyCode The Code is as follows: 'Personal code style annotation (the first lowercase alphabet in the variable name represents the variable type)
'I: Integer type;
'S: string;
Function u2utf8 (byval a_inum)
Dim sresult, suf8
Dim itemp, ihexnum, I
Ihexnum = trim (a_inum)
If ihexnum = "" then
Exit Function
End if
Sresult = ""
If (ihexnum <128) then
Sresult = sresult & ihexnum
Elseif (ihexnum <2048) then
Sresult = chrb (& h80 + (ihexnum and & h3f ))
Ihexnum = ihexnum \ & h40
Sresult = chrb (& hc0 + (ihexnum and & h1f) & sresult
Elseif (ihexnum <65536) then
Sresult = chrb (& h80 + (ihexnum and & h3f ))
Ihexnum = ihexnum \ & h40
Sresult = chrb (& h80 + (ihexnum and & h3f) & sresult
Ihexnum = ihexnum \ & h40
Sresult = chrb (& he0 + (ihexnum and & HF) & sresult
End if
U2utf8 = sresult
End Function
Function gb2utf (byval a_sstr)
Dim SGB, sresult, stemp
Dim ilen, iunicode, itemp, I
SGB = trim (a_sstr)
Ilen = Len (SGB)
For I = 1 to ilen
Stemp = mid (SGB, I, 1)
Itemp = ASC (stemp)
If (itemp> 127 or itemp <0) then
Iunicode = ASCW (stemp)
If iunicode <0 then
Iunicode = iunicode + 65536
End if
Else
Iunicode = itemp
End if
Sresult = sresult & u2utf8 (iunicode)
Next
Gb2utf = sresult
End Function
'Call Method
Response. binarywrite (gb2utf ("Chinese "))