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

Updated by naruse (Yui NARUSE) almost 14 years ago Actions #1

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34358.
John, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • io.c (rb_io_extract_modeenc): set ASCII-8BIT if binmode is specified
    with opthash. [ruby-core:42197] [Bug #5917]
Actions

Also available in: PDF Atom