1.&#x转汉字

  1. decodeUnicode(pValue){
  2. return unescape(pValue.replace(/&#x/g,'%u').replace(/;/g,''));
  3. }

2.汉字转&#x

  1. "大大".replace(/[^\u0000-\u00FF]/g,function(a){return escape(a).replace(/(%u)(\w{4})/gi,"&#x$2;")})