From: Eric Hodel Date: 2008-06-18T09:42:55+09:00 Subject: [ruby-core:17310] [Ruby 1.9 - Bug #178] (Open) File.open on sprintf-formatted string fails with encoding conversion error on OS X Issue #178 has been reported by Eric Hodel. ---------------------------------------- Bug #178: File.open on sprintf-formatted string fails with encoding conversion error on OS X http://redmine.ruby-lang.org/issues/show/178 Author: Eric Hodel Status: Open Priority: Normal Assigned to: Category: Target version: String#% and File.open are interacting strangely on OS X, so files opened with a sprintf formatted string raise an ArgumentError: $ ruby19 -vwe 'File.new("foo" % [])' ruby 1.9.0 (2008-06-18 revision 15873) [i686-darwin9.3.0] -e:1:in `initialize': transcoding not supported (from US-ASCII to UTF8-MAC) (ArgumentError) from -e:1:in `new' from -e:1:in `
' Using just "foo" as the filename works fine: $ ruby19 -we 'File.new("foo")' As does String#<<: $ ruby19 -we 'File.new("foo" << "")' ---------------------------------------- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account