W3C home > Mailing lists > Public > public-webapps-github@w3.org > August 2015

[fetch] Error Handle Chinese character for Charset=UTF-8 (#102)

From: Cam Song <notifications@github.com>
Date: Tue, 04 Aug 2015 19:51:40 -0700
To: whatwg/fetch <fetch@noreply.github.com>
Message-ID: <whatwg/fetch/issues/102@github.com>
I'm using Chrome(45.0.2454.15 beta (64-bit)) and Firefox(33.1.1) on Mac OS X 10.10.4. Both is supposed `fetch`.
I got messy code when the server response text has Chinese.

This is steps you can reproduce:
1. open http://xueqiu.com/
2. Open devtool console and type: 

var url = 'http://xueqiu.com/imgroups/search.json?q=%E5%A4%A7%E5%8A%9B&count=3&sg=1';
fetch(url, { method: 'get', credentials: 'include' }).then(function (res) {
  return res.json();
}).then(function (json) {
  return console.log('receive: ' + JSON.stringify(json));
Here is the response headers


response I got **大力**  which should be **大力**。This should not be an issue of server response, since it works when using `XMLHTTPRequest`.

Reply to this email directly or view it on GitHub:
Received on Wednesday, 5 August 2015 02:52:13 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 3 June 2021 23:43:35 UTC