Project

General

Profile

Actions

Bug #5917

closed

IO with :binmode => true should use binary encoding

Bug #5917: IO with :binmode => true should use binary encoding

Added by john_firebaugh (John Firebaugh) almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
Backport:
[ruby-core:42197]

Description

=begin
Binary mode sets the external encoding to binary when specified via the mode string, but not when specified by the :binmode option.

IO.new(0, 'wb').external_encoding #=> #Encoding:ASCII-8BIT
IO.new(0, 'w', :binmode => true).external_encoding #=> nil

The expected behavior is that :binmode => true should also set the external encoding to binary.
=end

Actions

Also available in: PDF Atom