diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-11 11:23:35 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-11 11:23:35 +0000 |
commit | 3f34ecc536f6b569774e2c41702cf70020d962b6 (patch) | |
tree | d67df27b6c6fc9334d0600caf22d145e04276824 | |
parent | c1b24588d378ae1d976ebd1521f2d9083214f9e7 (diff) | |
download | ruby-3f34ecc536f6b569774e2c41702cf70020d962b6.tar.gz |
* lib/net/http.rb (HTTP.get): specify ASCII-8BIT as the result
encoding of Zlib::GzipReader.
http://hibari.2ch.net/test/read.cgi/tech/1281473294/271
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/net/http.rb | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Mon Oct 11 20:20:23 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * lib/net/http.rb (HTTP.get): specify ASCII-8BIT as the result + encoding of Zlib::GzipReader. + http://hibari.2ch.net/test/read.cgi/tech/1281473294/271 + Mon Oct 11 17:42:54 2010 NARUSE, Yui <naruse@ruby-lang.org> * error.c (syserr_initialize): use mesg's encoding when locale diff --git a/lib/net/http.rb b/lib/net/http.rb index 0ae1ba8c8f..a4e2cee8e5 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -883,7 +883,7 @@ module Net #:nodoc: the_body = r.read_body dest, &block case r["content-encoding"] when "gzip" - r.body= Zlib::GzipReader.new(StringIO.new(the_body)).read + r.body= Zlib::GzipReader.new(StringIO.new(the_body), encoding: "ASCII-8BIT").read r.delete("content-encoding") when "deflate" r.body= Zlib::Inflate.inflate(the_body); |