楼上代码在本机的运行结果:
<SCRIPT LANGUAGE="VBScript">
'------------------------------
msgbox(Chr(54992))//*******OK******
msgbox(Chr(20013))//error
msgbox(ChrW(54992))//Same as JavaScript
msgbox(ChrW(20013))//OK
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
alert(String.fromCharCode(54992));//same as VBScript
alert(String.fromCharCode(20013));//OK
</SCRIPT>
'--------------------------------------
“中”对应的54992是通过以下方法计算出的,
如何计算出为20013,请指教!!
function fixed(listName)
dim i,tmp,j,ret,t
for i=0 to document.all(listName).length -1
select case listname
case "list1"
tmp=document.all.list1.options(i).text
case "country"
tmp=document.all.country.options(i).text
case "list2"
tmp=document.all.list2.options(i).text
end select
ret=""
for j=1 to len(tmp)
t=ascb(mid(tmp,j,1))
if t>128 then
j = j+1
t= t*256 + ascb(mid(tmp,j,1))
'alert(t)
end if
'ret = ret & chr(t)
ret = ret & "**" & t
next
document.all(listName).options(i).text = ret
next
end function