whatwg / xhr

XMLHttpRequest Standard
https://xhr.spec.whatwg.org/
Other
314 stars 129 forks source link

xmlhttprequest.responseText occasionally appears Chinese garbled characters #368

Closed feibirds closed 1 year ago

feibirds commented 1 year ago

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)

annevk commented 1 year ago

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.