function prase string to gb2312 in js
function gb2312(key)
{
var r = "";
for(var i=0;i<key.length;i++)
{
var t = key.charCodeAt(i);
if(t>=0x4e00 || t==0x300A || t==0x300B)
{
try
{
execScript("ascCode=hex(asc(\""+key.charAt(i)+"\"))", "vbscript"); r += ascCode.replace(/(.{2})/g, "%$1"); }
catch(e)
{}
}
else{r += escape(key.charAt(i))}
}
return r;
}
{
var r = "";
for(var i=0;i<key.length;i++)
{
var t = key.charCodeAt(i);
if(t>=0x4e00 || t==0x300A || t==0x300B)
{
try
{
execScript("ascCode=hex(asc(\""+key.charAt(i)+"\"))", "vbscript"); r += ascCode.replace(/(.{2})/g, "%$1"); }
catch(e)
{}
}
else{r += escape(key.charAt(i))}
}
return r;
}