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 `<main>'
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.