Project

General

Profile

Actions

Bug #9765

closed

StringIO#putc is unnaware of encoding

Added by nobu (Nobuyoshi Nakada) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
ruby -v:
r45637
[ruby-dev:48114]

Description

IO#putcはエンコーディングを意識しますが、StringIO#putcがしていません。

IO.pipe{|r,w| w.putc("\u{3042}"); w.putc(0x3044); w.close; p r.read}
# => "あD"

require 'stringio'
sio = StringIO.new(""); sio.putc("\u{3042}"); sio.putc(0x3044); p sio.string
# => "\xE3D"

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

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

Applied in changeset r45646.


stringio.c: non-ascii encoding

  • ext/stringio/stringio.c (strio_putc): fix for non-ascii
    encoding, like as IO#putc. [ruby-dev:48114] [Bug #9765]

Updated by usa (Usaku NAKAMURA) over 10 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: DONE, 2.1: REQUIRED

backported into ruby_2_0_0 at r46197.

Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago

  • Backport changed from 2.0.0: DONE, 2.1: REQUIRED to 2.0.0: DONE, 2.1: DONE

r45646 was backported into ruby_2_1 branch at r46197.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0