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"
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0