ASP实现GB2312字符与区位码的相互转换的代码(3)
Exit Function
end if
end if
'-------------检查完毕------------------
iHigh=Clng(Left(str,2))
iLow=Clng(Right(str,2))
iHigh=iHigh + 32 + 128
iLow=iLow + 32 + 128
sHex=Hex(iHigh) & Hex(iLow)
QWMToChar=Chr("&H" & sHex)
End Function
使用方法:
-----------------------------------------------------------------------------------------------------
复制代码 代码如下:
dim i,str,sChar
str="娃哈哈"
for i=1 to Len(str)
sChar=Mid(str,i,1)
Response.write sChar & ":" & CharToQWM(sChar) &"<br>"
next
-----------------------------------------------------------------------------------------------------
dim str
str="1601|1602|1603}
if instr(str,"|")>0 then
dim s,sCharArray,i
sCharArray=Split(str,"|")
for i=0 to Ubound(sCharArray)
s=s & QWMToChar(trim(sCharArray(i)),True)
next
str=s
else
str=QWMToChar(str,True)
end if
-----------------------------------------------------------------------------------------------------
3.在线使用
http://www.mytju.com/classcode/tools/quweima.asp
进入以上网址即可在线查阅。