Join GitHub today
IO.new encoding "fallback" syntax for mode broken in 1.9 #1766
When opening files in 1.9.x the following mode specification is valid: "r:bom|utf-8"
This seems to be a fallback syntax "if you can't open it in bom mode try utf-8".
I found the entry for the same bug for jruby http://jira.codehaus.org/browse/JRUBY-6320 but not the documented source yet.
The following code reproduces the problem
path="something.txt" open path, "r:bom|utf-8" do |f| f.read end
added a commit
Jul 11, 2012
FWIW, the code in JRuby is here: https://github.com/jruby/jruby/blob/master/src/org/jruby/RubyIO.java#L4407