% E4 % bb % 8a % E5 % a4 % a9 % E6 % 90 % 9e sxna % 2c % e9 % 81 % E5 % 88 % B4 % ba % 86 % E7 % BC % 96 % E7 % A0 % 25 % 20 % % E4 % ba % 86 % E5 % a6 % 82 % E4 % b8 % E7 % 9a % E6 % B1 % E5 % ad % 97 % E8 % BD % AC % E6 % 8d % a2 % EC % 208 b % E5 % ba B1 % E5 % a5 % BD % E8 % 80 % ef % BC % 81 % 0a % 20------------ % ef % BC % 9f % 209 a % 84 utf % ef % % 8f % E8 % BF % 87 decodeuricomponent % E5 % 8f % 98 % E6 % 88 % E6 % B1 % E5 % ad % 97 % 0a % 20 % E7 % 94 % a8g % 20 ogle.cle 8 Baidu % ee % 20bf % 87 ansicode % E5 % 8f % 98 % E4 % b8 % ba % ba % D7 % D6 % 0a % 20ba % D7 % D6 % E7 % bb % 8f % E8 % BF % E8 % b8 % bb du.com % 2f Baidu %3fword % 3d % Bai % 25 % 20------------ 0a % 20 % E6 % B1 % 89 % E5 % % ad % 97 % 0a % 20---------------- % 20.ASP % E5 % 8e % 9f % E7 % A8 % E5 % ba % 8f % E5 % a6 % % E7 % BC % 96 % E7 % A0 % 81 % E8 % BD % AC % 25 % 20 % 81 % 87 % E5 % 88 % B0 % E4 % ba % 86 % E7 % BC % 96 % E7 % A0 % A0 % 81 % A0 % 81 % E5 % bb d % 83 % E8 % be % E4 % b8 % 87 % E8 % 8b % a6 % ef % BF % 25 % 204 % E6 % B1 % E5 % ad % 97 % E8 % BD % AC % E6 % 8d % a2 % E2 % ed % 89 % B9 % E6 % ad % E5 % a5 % E7 % 8c % ae7 % bb % 99 % E5 % 20 varss % 3b % 0a % 20 vardd % 3b % 0a % 20ss %3decodedeuricodeuricocompompompon ogle % E7 % 9a % 84 utf % E7 % BC % 96 % E7 % A0 % 81 % 0a % 20 % E6 % B1 % 89 % E5 % ad % 97 % 20 % ad % 97 % E7 % bb % 8f % ed 25 % 20t8%2clow8% 0a % 20 strreturn % 3d % 27 % 27 % 0a % 20 fori % 3d1tolen % 28 vstr in % 29 % 0a % 20 this chr % 3d mid % 28 vsttred sc % 28 this chr % 29 % 0a % 20 ifinnercode % 0a % 20 innercode %3dinnnercode % 253 % 20 odeandhff 00 % 29 %5chff % 0a % 20 low 8 27h ex % 28 hight8% 29 % 20 icode % 3d strreturn % 0a % 20 end function % 0a % 20 functiondecodeansi % 28s % 29 % 0a % 20 dimi % 2cs ttts d % 27 % 25 % 27 then % 0a % 20 stmp % 3d % 27h % 27mid % 28s % 2ci % 201 %2C2 % 29 % 00a % 25 % 20di % 202 % 0a % 20 else if cint
mp;H" & Mid(s,i+4,2)If isNumeric(sTmp1) Then
sResult = sResult & Chr(CInt(sTmp)*16*16 + CInt(sTmp1))
i = i + 5
End If
Else
sResult = sResult & Chr(sTmp)
i = i + 2
End If
End If
Else
sResult = sResult & Mid(s,i,1)
End If
Else
sResult = sResult & Mid(s,i,1)
End If
Next
DeCodeAnsi = sResult
End Function
符合BAIDU的UTF-8编码
汉字 经过 AnsiCode 变为
%BA%BA%D7%D6 经过 DeCodeAnsi 变为
'汉字转换为UTF-8
function chinese2unicode(Str)
dim i
dim Str_one
dim Str_unicode
for i=1 to len(Str)
Str_one=Mid(Str,i,1)
Str_unicode=Str_unicode&chr(38)
Str_unicode=Str_unicode&chr(35)
Str_unicode=Str_unicode&chr(120)
Str_unicode=Str_unicode& Hex(ascw(Str_one))
Str_unicode=Str_unicode&chr(59)
next
chinese2unicode=Str_unicode
end function
'UTF-8 To GB2312
function UTF2GB(UTFStr)
for Dig=1 to len(UTFStr)
if mid(UTFStr,Dig,1)="%" then
if len(UTFStr) >= Dig+8 then
GBStr=GBStr & ConvChinese(mid(UTFStr,Dig,9))
Dig=Dig+8
else
GBStr=GBStr & mid(UTFStr,Dig,1)
end if
else
GBStr=GBStr & mid(UTFStr,Dig,1)
end if
next
UTF2GB=GBStr
end function
function ConvChinese(x)
A=split(mid(x,2),"%")
i=0
j=0
for i=0 to ubound(A)
A(i)=c16to2(A(i))
next
for i=0 to ubound(A)-1
DigS=instr(A(i),"0")
Unicode=""
for j=1 to DigS-1
if j=1 then
A(i)=right(A(i),len(A(i))-DigS)
Unicode=Unicode & A(i)
else
i=i+1
A(i)=right(A(i),len(A(i))-2)
Unicode=Unicode & A(i)
end if
next
if len(c2to16(Unicode))=4 then
ConvChinese=ConvChinese & chrw(int("&H" & c2to16(Unicode)))
else
ConvChinese=ConvChinese & chr(int("&H" & c2to16(Unicode)))
end if
next
end function
function c2to16(x)
i=1
for i=1 to len(x) step 4
c2to16=c2to16 & hex(c2to10(mid(x,i,4)))
next
end function
function c2to10(x)
c2to10=0
if x="0" then exit function
i=0
for i= 0 to len(x) -1
if mid(x,len(x)-i,1)="1" then c2to10=c2to10+2^(i)
next
end function
function c16to2(x)
i=0
for i=1 to len(trim(x))
tempstr= c10to2(cint(int("&h" & mid(x,i,1))))
do while len(tempstr)<4
tempstr="0" & tempstr
loop
c16to2=c16to2 & tempstr
next
end function
function c10to2(x)
mysign=sgn(x)
x=abs(x)
DigS=1
do
if x<2^DigS then
exit do
else
DigS=DigS+1
end if
loop
tempnum=x
i=0
for i=DigS to 1 step-1
if tempnum>=2^(i-1) then
tempnum=tempnum-2^(i-1)
c10to2=c10to2 & "1"
else
c10to2=c10to2 & "0"
end if
next
if mysign=-1 then c10to2="-" & c10to2
end function
%>
汉字经过chinese2unicode变为
(需要察看源代码,浏览器已经直接翻译)
汉字经过UTF2GB变为
(需要察看源代码,浏览器已经直接翻译)
另外在网上发现了一个不错的编码转换小站
http://www.dheart.net/bmzh/index.php