81,091
社区成员
发帖
与我相关
我的任务
分享
alert(UrlEncode("中国"));
function UrlEncode(str)
{
str = str.replace(/./g,function(sHex)
{
window.EnCodeStr = "";
window.sHex = sHex;
window.execScript('window.EnCodeStr=Hex(Asc(window.sHex))',"vbscript");
return window.EnCodeStr.replace(/../g,"%$&");
});
return str;
}