From: Heesob Park Date: 2013-05-19T01:07:04+09:00 Subject: Re: Ruby 'gets' truncates input to 256 characters (Windows) Hi, 2013/5/18 jen Marsh : > Is this a 'feature' of Ruby on windows? > I am trying to enter a long string (> 256 characters but generally < > 512) in Ruby with: > > puts "Enter long string" > ilogo = gets.chomp > puts ilogo > > For some reason, it always truncates the input to keep only 256 > characters (before chomp). > I verified that Ruby accepts longer strings, and that Windows 7 command > line console also accepts strings > 256 chars. I have seen that people > don't have the issue with MacOS, but others do have it with Windows XP. > I am running Win7. I can't find any mention of the gets method having > that type of limitation, but I am surely missing something. Could that > be just a 'gets' limitation for Ruby running on Windows? > This is a feature of Ruby on Windows. This undesired feature was raised from change sets which workaround a bug of ReadFile Win32 API . Refer to http://bugs.ruby-lang.org/issues/3014 http://bugs.ruby-lang.org/issues/4097 If you think this is a bug, please make an issue on http://bugs.ruby-lang.org Regards, Park Heesob