我正在尝试加载包含德语字符的RSS(<$,<$,<$.)
xhrRequest.responseText已包含已转换的字符(\u00f...)
在没有手动替换的情况下,是否可以强制正确编码,以便原始字符保持可见?
var url = 'https://apolut.net/feed/podcast/'
xhrRequest = new XMLHttpRequest();
xhrRequest.onreadystatechange = function() {
if (xhrRequest.readyState == 4) {
}
}
xhrRequest.onerror = function(e) {
};
xhrRequest.open('GET', url);
xhrRequest.setRequestHeader("Content-Type", "text/xml");
xhrRequest.send();
字符串
我在页面顶部有utf:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
型
1条答案
按热度按时间js4nwp541#
接收数据后,使用
decodeURIComponent()
将Unicode再次转换为字符文本。字符串
如果您收到的响应不是JSON,
型