// Convert the encoding to gb2312 Encoding
Function UrlEncode (str)
{
Var I, c, ret = "", strSpecial = "! \ "# $ % & '() * +,/:; <=>? @ [\] ^ '{| }~ % ";
For (I = 0; I <str. length; I ++)
{
// Alert (str. charCodeAt (I ));
C = str. charAt (I );
If (c = "")
Ret + = "+ ";
Else if (strSpecial. indexOf (c )! =-1)
Ret + = "%" + str. charCodeAt (I). toString (16 );
If (z [str. charCodeAt (I)]! = Null)
{
D = z [str. charCodeAt (I)];
Try
{
Ret + = "%" + d. slice (0, 2) + "%" + d. slice (-2 );
}
Catch (e)
{
Alert ("$ error name =" + e. name + ", message =" + e. message + ", d" + I + "=" + str. charCodeAt (I ))
}
}
Else
Ret + = c;
}
Return ret;
}
Function getSpell (str, sp)
{
Var I, c, t, ret = "";
If (sp = null)
Sp = "";
For (I = 0; I <str. length; I ++)
{
If (str. charCodeAt (I)> = 0x4e00)
{
C = parseInt (z [str. charCodeAt (I)], 16 );
If (c <1, 55290)
{
For (t = qswhSpell. length-1; t> 0; t = t-2)
If (qswhSpell [t] <= c)
Break;
If (t> 0)
Ret + = qswhSpell [t-1] + sp;
}
}
}
Return ret. substr (0, ret. length-sp.length );
}