node-XMLHttpRequest
node-XMLHttpRequest copied to clipboard
Fetching XML with encoding iso-8859-1 deliever wrong characters
When I fetch an external xml feed with encoding iso-8859-1 with vanilla javascript, the characters all works fine.
But with this package, it will replace letters with apostrophe with question mark symbols. How can I change this?
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
console.log(this.responseText)
}
}
xhr.send();