From: Michael Selig Date: 2008-12-21T14:10:48+09:00 Subject: [ruby-core:20745] Re: Working with binary strings in Ruby 1.9? On Sun, 21 Dec 2008 14:16:28 +1100, James Gray wrote: >>> In 1.9 use: >>> >>> File.binread(���) >> >> Alternatively you can specify 'encoding: "BINARY"' eg: >> >> File.open(, encoding: "BINARY") {|f| f.read} >> or shorter >> File.read(, encoding: "BINARY") > > I don't think you want to do that. You need to set a mode like "rb" to > also shut off line ending conversion on Windows. Sorry, you are quite right. I guess what I was trying to say that if you have code working in 1.8, adding 'encoding: "BINARY"' to the "open" is all you should need to do, as mode "rb" would also be required in 1.8, I believe. Mike