level 2
把下面分隔线内民另存为*.htm再用ie打开 ,-----------------------------------------------
汉字ASCII码,UTF8码换算
文本文字
-7303;-11070;-12089;-14271;
ASCII代码串
文本文字
76;117;110;97;95;72;97;119;107;
UTF8代码串
function CalcuTUF8(){ var oStr,i,sLen,uArr; var uText = document.fmCalcu.uText.value; var uCode = document.fmCalcu.uCode.value; oStr = ""; if(uText.length>0){ sLen = uText.length; for(i=0;i<sLen;i++) { oStr = oStr + uText.charCodeAt(i) + " "; } document.fmCalcu.uCode.value = oStr; }else{ uArr = uCode.split(";"); sLen = uArr.length; for(i=0;i<sLen-1;i++) { oStr = oStr + String.fromCharCode(uArr[i]) if(i>1200) {break;} } document.fmCalcu.uText.value = oStr; } }
function CalcuASCII()Dim oStr,sLen,i,uArr aText = document.fmCalcu.aText.value aCode = document.fmCalcu.aCode.value oStr = "" if Len(aText)>0 Then sLen = Len(aText) for i=1 to sLen ascode = Asc(Mid(aText,i,1)) if ascode < 0 then ascode = ascode + 65536 oStr = oStr & ascode & " " next document.fmCalcu.aCode.value = oStr else uArr = split(aCode,";") sLen = uBound(uArr) for i=0 to sLen if isNumeric(uArr(i)) then if Abs(uArr(i))<32768 then oStr = oStr & Chr(uArr(i)) end if end if if i>1200 then exit for next document.fmCalcu.aText.value = oStr end ifend function
----------------------------------------------------------------
2007年08月09日 12点08分