# ISO-8859-16 not supported?

**URL:** <https://www.ruby-forum.com/t/iso-8859-16-not-supported/237387>\
**Category:** Rails I18n\
**Created:** [November 10, 2013, 11:33am UTC](https://www.ruby-forum.com/t/iso-8859-16-not-supported/237387 "2013-11-10T11:33:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [November 10, 2013, 11:33am UTC](https://www.ruby-forum.com/t/iso-8859-16-not-supported/237387/1 "2013-11-10T11:33:39Z")

</div>

Hi,  
I understood ISO-8859-16 was among the supported encoding but I get this  
error:

Encoding::ConverterNotFoundError: code converter not found for  
ISO-8859-16  
org/jruby/RubyString.java:7597:in `encode’

On this line:

code = code.encode(internal\_encoding) # internal\_encoding = ‘UTF-8’

I can read the file correctly with:

code = IO.read(path,{ :encoding =\> file\_encoding, :mode =\> ‘rb’}) #  
file\_encoding = ‘ISO-8859-16’

Any thoughts?

---

<div class="post-metadata">

**Author:** ![ray02](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@ray02](https://www.ruby-forum.com/u/ray02)\
**Post date:** [November 11, 2013, 2:20am UTC](https://www.ruby-forum.com/t/iso-8859-16-not-supported/237387/2 "2013-11-11T02:20:23Z")

</div>

iso-8859-16 is supported in C Ruby from commit 33993 (Dec. 9th, 2011),  
please see  
[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/trans/iso-8859-16-tbl.rb?view=log](http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/trans/iso-8859-16-tbl.rb?view=log).

It looks as if you used JRuby. Can you tell us which version?

It may be that JRuby didn’t yet implement ISO-8859-16. I have cc’ed the  
JRuby implementers to get their feedback.

Regards, Martin.

---

<div class="post-metadata">

**Author:** ![ray02](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@ray02](https://www.ruby-forum.com/u/ray02)\
**Post date:** [November 11, 2013, 10:28am UTC](https://www.ruby-forum.com/t/iso-8859-16-not-supported/237387/3 "2013-11-11T10:28:47Z")

</div>

My bad, I was using JRuby 1.7.6, the problems do not appear with the  
original Ruby interpreter, version 2.0.

I have already opened an issue for JRuby.

More in details ruby 1.9.3 p 448 gives me this error:  
bugtest.rb:2:in `encode': code converter not found (ISO-8859-16 to UTF-8) (Encoding::ConverterNotFoundError) from bugtest.rb:2:in`’

Which seems to me more detailed in respect to the JRuby error.

Encoding::ConverterNotFoundError: code converter not found for  
ISO-8859-16  
encode at org/jruby/RubyString.java:7597  
(root) at bugtest.rb:2

Ruby 2.0 runs smoothly instead, no errors raised.

---

<div class="post-metadata">

**Author:** ![ray02](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@ray02](https://www.ruby-forum.com/u/ray02)\
**Post date:** [November 11, 2013, 5:54pm UTC](https://www.ruby-forum.com/t/iso-8859-16-not-supported/237387/4 "2013-11-11T17:54:21Z")

</div>

Thanks for the redirect, Martin.

It turns out OpenJDK does not support ISO-8859-16 in its builtin  
charsets, so I had to go ahead and implement one on my own. Fixed now  
for JRuby 1.7.7 and master.

- Charlie

On Sun, Nov 10, 2013 at 8:18 PM, “Martin J. Dürst”
