whatwg/xhr

xmlhttprequest.responseText occasionally appears Chinese garbled characters

feibirds opened this issue · 1 comments

image

  1. We use XMLHttpRequest to initiate a request and get the response packet from the server, which is normal encoding;

  2. We use the following code to get the data packet (occasionally appear) Chinese garbled characters, not necessarily.

var text = this._xmlHttpRequest.responseText;
console. log(text);
return text;

  1. Please refer to the attached screenshot for details of garbled characters;

Additional information:
This problem did not exist years ago, but it only appeared after the upgrade of the Google kernel. The same product has no problem without the upgrade of the Google kernel; after the year, there are customers and tests that have this problem (some Chinese characters are occasionally garbled)

I'm not familiar with the Google kernel or your product. Try Stack Overflow or support channels for your product. This is the repository of the XMLHttpRequest Standard and the text decoding rules haven't changed.

You can read about them here: https://xhr.spec.whatwg.org/#the-responsetext-attribute.