ruby-changes:17437
From: naruse <ko1@a...>
Date: Mon, 11 Oct 2010 20:23:45 +0900 (JST)
Subject: [ruby-changes:17437] Ruby:r29442 (trunk): * lib/net/http.rb (HTTP.get): specify ASCII-8BIT as the result
naruse 2010-10-11 20:23:35 +0900 (Mon, 11 Oct 2010) New Revision: 29442 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29442 Log: * 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 Modified files: trunk/ChangeLog trunk/lib/net/http.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 29441) +++ ChangeLog (revision 29442) @@ -1,3 +1,9 @@ +Mon Oct 11 20:20:23 2010 NARUSE, Yui <naruse@r...> + + * 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@r...> * error.c (syserr_initialize): use mesg's encoding when locale Index: lib/net/http.rb =================================================================== --- lib/net/http.rb (revision 29441) +++ lib/net/http.rb (revision 29442) @@ -883,7 +883,7 @@ 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/