From: Tanaka Akira Date: 2004-02-01T05:23:43+09:00 Subject: Re: nuby: can't get an image via http In article <200401271823.35269.emmanuel.touzery@wanadoo.fr>, Emmanuel Touzery writes: > I confirm that the code i posted in the previous message (and that I repost > here) works under linux. the fact it doesn't work under windows is definitely > related to the binary flag of the files. maybe it's a bug in open-uri that > the file is not in binary mode? How about following patch? Index: lib/open-uri.rb =================================================================== RCS file: /src/ruby/lib/open-uri.rb,v retrieving revision 1.19 diff -p -u -r1.19 open-uri.rb --- lib/open-uri.rb 31 Jan 2004 18:11:54 -0000 1.19 +++ lib/open-uri.rb 31 Jan 2004 20:12:57 -0000 @@ -221,6 +221,7 @@ module OpenURI if StringIO === @io && StringMax < @size require 'tempfile' io = Tempfile.new('open-uri') + io.binmode Meta.init io, @io if Meta === @io io << @io.string @io = io -- Tanaka Akira