Issue #4097 has been updated by Hiroshi Nakamura.

Target version changed from 1.9.x to 1.9.3


----------------------------------------
Bug #4097: Unexpected result of STDIN.read on Windows
http://redmine.ruby-lang.org/issues/4097

Author: Heesob Park
Status: Assigned
Priority: Normal
Assignee: Masaya Tarui
Category: core
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2010-11-28 trunk 29965) [i386-mswin32_90]


=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



-- 
http://redmine.ruby-lang.org