VBScript中chr(54992)可以吗?<SCRIPT LANGUAGE="VBScript">
msgbox(Chr(54992))//error
msgbox(Chr(20013))//error
msgbox(ChrW(54992))//Some with JavaScript
msgbox(ChrW(20013))//OK
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
alert(String.fromCharCode(54992));//same with VBScript
alert(String.fromCharCode(20013));//OK
</SCRIPT>
msgbox(Chr(54992))//error
msgbox(Chr(20013))//error
msgbox(ChrW(54992))//Some with JavaScript
msgbox(ChrW(20013))//OK
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
alert(String.fromCharCode(54992));//same with VBScript
alert(String.fromCharCode(20013));//OK
</SCRIPT>
<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
<script>
function chr(num){
num=num-0xB0A1;
return strGB.charAt((num>>8)*94+(num&0xff))
}
alert(chr(54992))
</script>
Gb2312 : 54992
Unicode: 20013取得Unicode
<script>
alert("繁體字".charCodeAt(1))
</script>