Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.5
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Ruby 1.9.2
-
Labels:None
-
Environment:Mac OSX Lion
Jruby 1.6.5.1
JRUBY_OPTS="--1.9"
-
Number of attachments :
Description
File.open supports option "r:bom|utf-8" in 1.8 mode, but not in 1.9 mode.
I came across this trying to use the Hoe library (cf. https://github.com/seattlerb/hoe/blob/master/lib/hoe.rb, function read_utf), which works in 1.8, but not in 1.9.
`File.open 'Manifest.txt', "r:bom|utf-8"` will yield the following error stack:
ArgumentError: unknown encoding name - bom|utf-8
from org/jruby/RubyIO.java:1066:in `set_encoding'
from org/jruby/RubyFile.java:464:in `initialize'
from org/jruby/RubyIO.java:1111:in `open'
I should say, it appears these file encodings are not supported at all in 1.8 mode, and they have not yet been added in 1.9.