一文详解JavaScript的转码方式
function decode(str) {
var r = '';
try {
r = decodeURIComponent(decodeURIComponent(str));
}catch(e){
try {
r = decodeURIComponent(str);
} catch(e) {
try {
r = unescape(str); //Unicode
}catch(e) {
r = str;
}
}
}
return r;
}