//UTF字符转换
var UTFTranslate = {
Change:function(pValue){
return pValue.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"&#x$2;")});
},
ReChange:function(pValue){
return unescape(pValue.replace(/&#x/g,'%u').replace(/\\u/g,'%u').replace(/;/g,''));
}
};

//Asc转换
var AscTranslate = {
Change: function(pAscString, pBoxId){
/* 转ASCII */
box = document.getElementById(pBoxId);
box.innerHTML = '';
for(i = 0; i < pAscString.length; i++)
{
var asc = pAscString.charCodeAt(i);
var str = String.fromCharCode(asc);
box.innerHTML += str + ':' + asc + '<br/>';
}
}
}

相关文章:

  • 2021-11-30
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-09-07
猜你喜欢
  • 2022-02-04
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-02-05
相关资源
相似解决方案