-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding::ConverterNotFoundError when using Encoding.default_internal #3647
Comments
I went back and installed MRI $ rbenv shell 2.2.3
$ ruby ./example.rb
OK! |
I am not positive this is a parser issue but something is amiss. Is this also an issue if that file has a bom and some contents? |
Works fine with bom (with or without other content): $ printf '\xFF\xFE' > empty-file
$ jruby ./example.rb
OK!
$ printf '\xFF\xFE hello' > empty-file
$ jruby ./example.rb
OK! |
Looking into this. |
Minor bit of code missing from our BOM stripping logic, to clear the external encoding if no BOM could be found. Unexcluded a test from CRuby that's now passing. Yay! |
👍 |
I have jruby-9.1.0.0-SNAPSHOT (JRUBY_REVISION=cea55fb) from RVM, failing with this error, without there being a BOM in sight, as far as I can tell.
|
@pobocks Can you try running the example code in the original post to confirm it's the same bug |
Will do - putting a BOM in my .env allowed the process to continue, so it
|
Confirmed: $ touch empty-file
$ rvm jruby-head do ruby example.rb
Encoding::ConverterNotFoundError: code converter not found (UTF-8 to UTF-8)
read at org/jruby/RubyIO.java:2972
read at org/jruby/RubyIO.java:2950
block in example.rb at example.rb:2
open at org/jruby/RubyIO.java:1124
<top> at example.rb:2 |
Replicated on an Amazon linux box (probably whatever their Red Hat one is) and OSX 10.9.5 local. |
jRuby versions affected:
9.0.4.0
,9.0.5.0
and possibly earlier ones that I didn't test.jRuby throws an
Encoding::ConverterNotFoundError
error when trying to open aBOM:UTF-8
file after settingEncoding.default_internal
. This does not mirror the behavior of MRI.I was able to narrow it down to the following reproduction snippet:
Here are the erroneous results:
And here's the same script working with MRI
2.2.4
,2.3.0
, and jRuby1.7.24
:My environment:
The text was updated successfully, but these errors were encountered: