FineReport 导出汉字乱码

window.location.href = "<%=reportPath_F%>help06042Report.cpt&showtoolbar=false&bypagesize=false&beginTime="+beginTime4+"&op=export&format=excel&filename="+cjkEncode("报障咨询情况及占比率");
function cjkEncode(text) {
if (text == null) {
return "";
}
var newText = "";
for (var i = 0; i < text.length; i++) {
var code = text.charCodeAt(i);
if (code >= 128 || code == 91 || code == 93) {//91 is "[", 93 is "]".
newText += "[" + code.toString(16) + "]";
} else {
newText += text.charAt(i);
}
}
return newText;
}

原文地址:https://www.cnblogs.com/chonghaojie/p/9098513.html