{"action":"created","issue":{"url":"https://api.github.com/repos/ztellman/aleph/issues/138","labels_url":"https://api.github.com/repos/ztellman/aleph/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/ztellman/aleph/issues/138/comments","events_url":"https://api.github.com/repos/ztellman/aleph/issues/138/events","html_url":"https://github.com/ztellman/aleph/issues/138","id":56162396,"number":138,"title":"Malformed byte-stream input to CharsetDecoder","user":{"login":"shmish111","id":934267,"avatar_url":"https://avatars.githubusercontent.com/u/934267?v=3","gravatar_id":"","url":"https://api.github.com/users/shmish111","html_url":"https://github.com/shmish111","followers_url":"https://api.github.com/users/shmish111/followers","following_url":"https://api.github.com/users/shmish111/following{/other_user}","gists_url":"https://api.github.com/users/shmish111/gists{/gist_id}","starred_url":"https://api.github.com/users/shmish111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmish111/subscriptions","organizations_url":"https://api.github.com/users/shmish111/orgs","repos_url":"https://api.github.com/users/shmish111/repos","events_url":"https://api.github.com/users/shmish111/events{/privacy}","received_events_url":"https://api.github.com/users/shmish111/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-01T12:43:30Z","updated_at":"2015-02-01T18:21:02Z","closed_at":"2015-02-01T18:21:02Z","body":"Not really sure this issue should go here as it's a combination of bytestreams and aleph and possibly just me doing something wrong.\r\n\r\nThe following gives `IllegalArgumentException Malformed byte-stream input to CharsetDecoder  byte-streams.char-sequence/parse-result (char_sequence.clj:17)`\r\n\r\n```clojure\r\n(-> @(http/get \"http://www.google.ch/?gfe_rd=cr&ei=zhvOVNSyH6eH8QfbhoHoBg\")\r\n    :body\r\n    bs/to-string)\r\n```\r\n\r\nAm I using `bs/to-string` incorrectly?  Looking at the response headers I can see the charset specified and I tried:\r\n\r\n```clojure\r\n(-> @(http/get \"http://www.google.ch/?gfe_rd=cr&ei=zhvOVNSyH6eH8QfbhoHoBg\")\r\n    :body\r\n    (bs/to-string {:charset \"ISO-8859-1\"}))\r\n```\r\n\r\nbut the result is the same."},"comment":{"url":"https://api.github.com/repos/ztellman/aleph/issues/comments/72376463","html_url":"https://github.com/ztellman/aleph/issues/138#issuecomment-72376463","issue_url":"https://api.github.com/repos/ztellman/aleph/issues/138","id":72376463,"user":{"login":"ztellman","id":31295,"avatar_url":"https://avatars.githubusercontent.com/u/31295?v=3","gravatar_id":"","url":"https://api.github.com/users/ztellman","html_url":"https://github.com/ztellman","followers_url":"https://api.github.com/users/ztellman/followers","following_url":"https://api.github.com/users/ztellman/following{/other_user}","gists_url":"https://api.github.com/users/ztellman/gists{/gist_id}","starred_url":"https://api.github.com/users/ztellman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztellman/subscriptions","organizations_url":"https://api.github.com/users/ztellman/orgs","repos_url":"https://api.github.com/users/ztellman/repos","events_url":"https://api.github.com/users/ztellman/events{/privacy}","received_events_url":"https://api.github.com/users/ztellman/received_events","type":"User","site_admin":false},"created_at":"2015-02-01T18:21:01Z","updated_at":"2015-02-01T18:21:01Z","body":"Ha, okay, this took me way too long to figure out.  The problem is that you need to pass in `{:encoding \"ISO-8859-1\"}`, not `{:charset \"ISO-8859-1\"}`.  The secondary problem is that `(String. byte[])` is more forgiving of encoding issues than the alternate path.  Near term fix is to pass in the charset the proper way, longer term fix is for me to make the encoding errors less stringent, but configurable.\r\n\r\nMarking this as closed."}}