var mode="zhuan";
function encode(obj,btn){
if(mode=="zhuan"){
obj.value=obj.value.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"$2;")});
btn.value="还原";
mode="huan";
}else{
obj.value=unescape(obj.value.replace(//g,'%u').replace(/;/g,''));
btn.value="转化";
mode="zhuan";
}
阅读(1103) | 评论(0) | 转发(0) |