ActionsLike0
Bug #4097
closedUnexpected result of STDIN.read on Windows
Description
=begin
On Ruby 1.9.x, in case of non-ASCII input, STDIN.read(n) returns some garbage attached string.
C:\work>ruby -ve 'a=STDIN.read(10);p a;p a.length'
ruby 1.9.3dev (2010-11-28 trunk 29965) [i386-mswin32_90]
가나다라abcd
"\xB0\xA1\xB3\xAA\xB4\xD9\xB6\xF3ab\x00\x00\xB8t"
14
On the other hand, Ruby 1.8.6 works fine.
C:\work>ruby -ve 'a=STDIN.read(10);p a;p a.length'
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]
가나다라abcd
"\260\241\263\252\264\331\266\363ab"
10
=end
Updated by usa (Usaku NAKAMURA) over 14 years ago
- Status changed from Open to Assigned
- Assignee set to tarui (Masaya Tarui)
Updated by nahi (Hiroshi Nakamura) almost 14 years ago
- Target version changed from 2.0.0 to 1.9.3
Updated by tarui (Masaya Tarui) over 13 years ago
- Status changed from Assigned to Third Party's Issue
ActionsLike0