Issue #1847 has been updated by Brett Carswell.


I have two different ruby executables exhibiting this behaviour. One is 'ruby 1.9.2dev (2009-07-31 trunk 24332) [i386-mswin32_90]' and the other 'ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mingw32]'

If I output the encoding with some trace such as 'puts rnd.encoding.name' within the random_number method it reports US-ASCII on Windows and ASCII-8BIT on Linux. I presume the exception is because whatever value is in the first position of the rnd array does not correspond to a valid character in the US-ASCII char set. Other than a code fix, I guess it may be possible to somehow configure the encoding via an environment variable. I don't know enough about how ruby is determining the encoding to be able to accomplish this.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1847

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