From: Joey Zhou Date: 2011-06-20T16:59:54+09:00 Subject: [ruby-core:37238] [Ruby 1.9 - Bug #4908][Open] #force_encoding(nil) fails on Windows Issue #4908 has been reported by Joey Zhou. ---------------------------------------- Bug #4908: #force_encoding(nil) fails on Windows http://redmine.ruby-lang.org/issues/4908 Author: Joey Zhou Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.2p180 (2011-02-18) [i386-mingw32] I read from The Ruby Programming Language that nil can be specified as "binary" or "ascii-8bit". The book give a sample code on Page 61: text = stream.readline.force_encoding("utf-8") bytes = text.dup.force_encoding(nil) # nil encoding means binary However, force_encoding(nil) doesn't work on Windows, it will raise a TypeError. Maybe it's a bug for Windows? ruby 1.9.2p180 (2011-02-18) [i386-mingw32] -- http://redmine.ruby-lang.org