{"action":"created","issue":{"url":"https://api.github.com/repos/bitinn/node-fetch/issues/184","repository_url":"https://api.github.com/repos/bitinn/node-fetch","labels_url":"https://api.github.com/repos/bitinn/node-fetch/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/bitinn/node-fetch/issues/184/comments","events_url":"https://api.github.com/repos/bitinn/node-fetch/issues/184/events","html_url":"https://github.com/bitinn/node-fetch/issues/184","id":182106137,"number":184,"title":"Charset detection","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-10T20:22:24Z","updated_at":"2016-10-11T04:33:22Z","closed_at":null,"body":"Originally reported by @gwicke in gwicke/node-fetch-polyfill#1.\r\n\r\nCurrently, node-fetch attempts to automatically detect the encoding of the input source, and [convert](https://github.com/bitinn/node-fetch/blob/e926483448c675b7443d2c085c49cee9d4619120/lib/body.js#L147) it to UTF-8. However, the [Fetch Standard](https://fetch.spec.whatwg.org/#concept-body-package-data) says that only a plain UTF-8 decode should be performed, regardless of the actual input encoding. As written in the referenced issue and confirmed by myself, the spec behavior is what's implemented by the browsers.\r\n\r\nA few options:\r\n\r\n1. Keep the current behavior\r\n2. Remove conversion process\r\n3. Use an option (e.g. `res.text({ convert: true })`)\r\n4. Make a new method (e.g. `res.textConverted()`)\r\n\r\nI'm leaning towards 4. 1 makes this module incompatible with the browser (something I don't want to do), 2 makes transition to v2 more difficult for people already using this library, and I'm reluctant to modify the behaviors of a well-defined function such as `.text()`.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/bitinn/node-fetch/issues/comments/252810266","html_url":"https://github.com/bitinn/node-fetch/issues/184#issuecomment-252810266","issue_url":"https://api.github.com/repos/bitinn/node-fetch/issues/184","id":252810266,"user":{"login":"bitinn","id":1484279,"avatar_url":"https://avatars.githubusercontent.com/u/1484279?v=3","gravatar_id":"","url":"https://api.github.com/users/bitinn","html_url":"https://github.com/bitinn","followers_url":"https://api.github.com/users/bitinn/followers","following_url":"https://api.github.com/users/bitinn/following{/other_user}","gists_url":"https://api.github.com/users/bitinn/gists{/gist_id}","starred_url":"https://api.github.com/users/bitinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitinn/subscriptions","organizations_url":"https://api.github.com/users/bitinn/orgs","repos_url":"https://api.github.com/users/bitinn/repos","events_url":"https://api.github.com/users/bitinn/events{/privacy}","received_events_url":"https://api.github.com/users/bitinn/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T04:33:22Z","updated_at":"2016-10-11T04:33:22Z","body":"OK I just checked, it's not worth going through this:\r\n\r\nhttps://github.com/whatwg/fetch/issues/353#issuecomment-237476765\r\n\r\nI support option 4."}}
{"actor":{"display_login":"bitinn"}}