Hello all,

Ruby 1.8.x can round trip a binary file with pack and unpack to
base64.  Ruby 1.9 returns false.  Not sure why, googling and reading
books leads me to believe this should be true in every version, can
any shed some light on this?

Ruby 1.8.6
> data = File.read('spec/fixtures/attachments/test.png')
> data == [data].pack( 'm' ).unpack( 'm' )[0]
=> true

Ruby 1.8.7-p174
> data = File.read('spec/fixtures/attachments/test.png')
> data == [data].pack( 'm' ).unpack( 'm' )[0]
=> true

Ruby 1.9.1-p129
> data = File.read('spec/fixtures/attachments/test.png')
> data == [data].pack( 'm' ).unpack( 'm' )[0]
=> false


test.png can be found at:

http://github.com/mikel/mail/blob/master/spec/fixtures/attachments/test.png

Thanks

Mikel

-- 
http://lindsaar.net/
Rails, RSpec and Life blog....