马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp,jsp,php是web开发的三大技术,asp简单易用且有microsoft做靠山,jsp功能强大是因为有java支持,php则开源跨平台.在国内,asp应用范围最广,jsp发展势头最猛,php则处于劣势.这可能与公司的支持以及技术的培训有关.汉字|转换汉字转换为UTF-8
functionchinese2unicode(Str)
dimi
dimStr_one
dimStr_unicode
fori=1tolen(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
Response.WriteStr_unicode
endfunction
UTF-8ToGB2312
functionUTF2GB(UTFStr)
forDig=1tolen(UTFStr)
ifmid(UTFStr,Dig,1)="%"then
iflen(UTFStr)>=Dig+8then
GBStr=GBStr&ConvChinese(mid(UTFStr,Dig,9))
Dig=Dig+8
else
GBStr=GBStr&mid(UTFStr,Dig,1)
endif
else
GBStr=GBStr&mid(UTFStr,Dig,1)
endif
next
UTF2GB=GBStr
endfunction
functionConvChinese(x)
A=split(mid(x,2),"%")
i=0
j=0
fori=0toubound(A)
A(i)=c16to2(A(i))
next
fori=0toubound(A)-1
DigS=instr(A(i),"0")
Unicode=""
forj=1toDigS-1
ifj=1then
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)
endif
next
iflen(c2to16(Unicode))=4then
ConvChinese=ConvChinese&chrw(int("&H"&c2to16(Unicode)))
else
ConvChinese=ConvChinese&chr(int("&H"&c2to16(Unicode)))
endif
next
endfunction
functionc2to16(x)
i=1
fori=1tolen(x)step4
c2to16=c2to16&hex(c2to10(mid(x,i,4)))
next
endfunction
functionc2to10(x)
c2to10=0
ifx="0"thenexitfunction
i=0
fori=0tolen(x)-1
ifmid(x,len(x)-i,1)="1"thenc2to10=c2to10+2^(i)
next
endfunction
functionc16to2(x)
i=0
fori=1tolen(trim(x))
tempstr=c10to2(cint(int("&h"&mid(x,i,1))))
dowhilelen(tempstr)<4
tempstr="0"&tempstr
loop
c16to2=c16to2&tempstr
next
endfunction
functionc10to2(x)
mysign=sgn(x)
x=abs(x)
DigS=1
do
ifx<2^DigSthen
exitdo
else
DigS=DigS+1
endif
loop
tempnum=x
i=0
fori=DigSto1step-1
iftempnum>=2^(i-1)then
tempnum=tempnum-2^(i-1)
c10to2=c10to2&"1"
else
c10to2=c10to2&"0"
endif
next
ifmysign=-1thenc10to2="-"&c10to2
endfunction
ASP脚本是采用明文(plaintext)方式来编写的。 |