<html>
<head>
<title>xml Http</title>
<script language=vbscript>
Function rsB(vIn)
rsB=MidB(vIn,1)
End Function
Function vbChar(ss)
vbChar = Chr(ss)
End Function
</script>
<script language=javascript>
//***Author: Hutia
//last modified by shouhaimu(QQ:30836570)
//速度已提高近50倍
//**全局变量**
//glbEncode储存ascii到unicode字符的转换,这样做的好处是可以提高重复解码时的解码效率
glbEncode=new Array();
//重编码
function reCode(b){
t=b.replace(/%([A-Z].)%(.{2})/g,"@$1$2");
t=t.split("@");
var i=0,j=t.length,k;
while(++i<j)
{
k=t[i].substring(0,4);
if(!glbEncode[k])glbEncode[k]=escape(vbChar(eval("0x"+k))).substring(1,6);
t[i]=glbEncode[k]+t[i].substring(4);
}
return unescape(t.join("%"));
}
function init(){
alert(reCode("%D6%D0%BB%AA%C8%CB%C3%F1%B9%B2%BA%CD%B9%FA"));
}
</script>
</head>
<body onload=init()>
</body>
</html>
posted on 2006-07-28 16:37
汪杰 阅读(583)
评论(2) 编辑 收藏 引用 所属分类:
javascript