参考:https://www.cnblogs.com/iwang5566/p/6798799.html
https://blog.csdn.net/weixin_30527143/article/details/99586265
http://blog.chinaunix.net/uid-11612688-id-67157.html
https://www.iteye.com/blog/coolpep-1344467
https://blog.csdn.net/xinghuo0007/article/details/53064038
// UTF8编码转成汉字字符串
function revertUTF8(szInput) {
var x,wch,wch1,wch2,uch="",szRet="";
for (x=0; x<szInput.length; x++) {
if (szInput.charAt(x)=="%") {
wch =parseInt(szInput.charAt(++x) + szInput.charAt(++x),16);
if (!wch) {break;}
if (!(wch & 0x80)) {
wch = wch;
} else if (!(wch & 0x20)) {
x++;
wch1 = parseInt(szInput.charAt(++x) + szInput.charAt(++x),16);
wch = (wch & 0x1F)<< 6;
wch1 = wch1 & 0x3F;
wch = wch + wch1;
} else {
x++;
wch1 = parseInt(szInput.charAt(++x) + szInput.charAt(++x),16);
x++;
wch2 = parseInt(szInput.charAt(++x) + szInput.charAt(++x),16);
wch = (wch & 0x0F)<< 12;
wch1 = (wch1 & 0x3F)<< 6;
wch2 = (wch2 & 0x3F);
wch = wch + wch1 + wch2;
}
szRet += String.fromCharCode(wch);
} else {
szRet += szInput.charAt(x);
}
}
return(szRet);
}