node-XMLHttpRequest icon indicating copy to clipboard operation
node-XMLHttpRequest copied to clipboard

Fetching XML with encoding iso-8859-1 deliever wrong characters

Open jonasdev opened this issue 5 years ago • 0 comments

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();

jonasdev avatar Apr 07 '20 08:04 jonasdev