mojombo/grit — pull request #165 by teleological (2013-04-13 21:13:42+00:00)
Title: Fix Tempfile args in Ruby 1.9 to use binary enc

Ruby 1.9 MRI doesn't appear to recognize an :opt option to IO::open. It does recognize :mode, which would accept "wb" but Tempfile performs a bitwise OR with that value if provided. It's possible to pass :binmode => true, but because of MRI bug 5917 (fixed in trunk but not in 1.9 releases), specifying binmode does not default to binary encoding, so this is explicitly specified with the :external_encoding option.