久久精品综合-欧美精品久久久久久-www一区二区-韩国三级中文字幕hd久久精品-国产一区二区三区在线-日韩免费视频

明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

UTF-8轉(zhuǎn)GB2312函數(shù)

[摘要]<% '用途:將UTF-8編碼漢字轉(zhuǎn)換為GB2312碼,兼容英文和數(shù)字 '版權(quán):雖說是原創(chuàng),其實(shí)也參考了別人的部分算法 '用法:Response.write UTF2GB("%E9%83%BD%E5%B8%82%E6%83%85%E7%B7%A3 %E6%9...

<%
'用途:將UTF-8編碼漢字轉(zhuǎn)換為GB2312碼,兼容英文和數(shù)字
'版權(quán):雖說是原創(chuàng),其實(shí)也參考了別人的部分算法
'用法:Response.write UTF2GB("%E9%83%BD%E5%B8%82%E6%83%85%E7%B7%A3 %E6%98%9F%E5%BA%A7")


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
%>




主站蜘蛛池模板: 日本韩国欧美三级 | 日本在线免费 | 日本免费在线视频 | 欧美一级视频在线观看欧美 | 青青青国产色视频在线观看 | 小视频福利 | 天天欲色 | 午夜片在线 | 欧美一级视频免费观看 | 青青青青手机在线观看 | 日本视频免费在线播放 | 亚洲第一成人影院 | 在线免费午夜视频 | 午夜精品久久久久久久99热 | 亚洲一区二区三区高清视频 | 日日麻批视频 | 青春草在线观看播放免费视频 | 亚洲激情久久 | 四虎 2022 永久网站 | 午夜不卡在线 | 热久久国产欧美一区二区精品 | 日日摸夜夜添欧美一区 | 亚洲一区免费看 | 午夜影院a | 日韩一区国产二区欧美三区 | 青草国产视频 | 欧美做真爱欧美观看免费 | 四虎影视在线永久免费观看 | 日韩黄网 | 婷婷六月久久综合丁香乐透 | 亚洲视频二区 | 亚洲成综合人影院在院播放 | 日韩城人视频 | 午夜aaa| 婷婷激情五月网 | 手机看片日韩日韩国产在线看 | 特级理论片| 日韩一级一欧美一级国产 | 人人公开免费超级碰碰碰视频 | 在线天堂中文在线网 | 日日摸人人拍人人澡 |