Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

chokes on encoding from google.com #22

Open
cvillecsteele opened this issue Jan 20, 2017 · 1 comment
Open

chokes on encoding from google.com #22

cvillecsteele opened this issue Jan 20, 2017 · 1 comment

Comments

@cvillecsteele
Copy link

Fresh out of the box, nodejs - GET request to www.google.com:

 {:user-info nil,
 :as :string,
 :headers
 {"accept" "text/html;charset=UTF-8",
  "accept-encoding" "gzip, deflate"},
 :server-port nil,
 :uri "",
 :server-name "www.google.com",
 :query-string nil,
 :scheme :http,
 :request-method :get}
TypeError: Unknown encoding: iso-8859-1
    at Buffer.slowToString (buffer.js:432:17)
    at Buffer.toString (buffer.js:445:27)
    at kvlt$platform$http$maybe_encode (/Users/colinsteele/Projects/tz/felix/julia/target/test/kvlt/platform/http.cljs:44:18)
    at Request._callback (/Users/colinsteele/Projects/tz/felix/julia/target/test/kvlt/platform/http.cljs:60:42)
    at Request.self.callback (/Users/colinsteele/Projects/tz/felix/julia/node_modules/request/request.js:200:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/Users/colinsteele/Projects/tz/felix/julia/node_modules/request/request.js:1067:10)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at Gunzip.<anonymous> (/Users/colinsteele/Projects/tz/felix/julia/node_modules/request/request.js:988:12)
    at emitNone (events.js:72:20)
    at Gunzip.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:921:12)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)```
@moea
Copy link
Member

moea commented Jan 20, 2017

@cvillecsteele I'm open minded about how to solve issues like that - Node doesn't support iso-8859-1 out of the box. If you add :as :byte-array to the request, you will get back the buffer, which you can encode yourself, e.g. w/ iconv - however, I wasn't sure depending on it was the right thing to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants