You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
# encoding: utf-8
require 'stringio'
s = StringIO.new
s << 'ā'
puts s.string
gives an Encoding::UndefinedConversionError: ""\xC4\x81"" from UTF-8 to US-ASCII error when executed likes this
$ LANG= jruby t.rb
Encoding::UndefinedConversionError: ""\xC4\x81"" from UTF-8 to US-ASCII
write at org/jruby/ext/stringio/StringIO.java:1140
<< at org/jruby/ext/stringio/StringIO.java:241
(root) at t.rb:4
version jruby-1.7.8 and before as well as MRI works like this:
$ LANG= ruby t.rb
ā
the same way as
$ LANG=en_US.UTF-8 jruby t.rb
ā
the problem causes problems with jruby/rubygems-servlets#5 since the behaviour of StringIO#<< seems to be platform dependent in the sense it depends on platform encoding. maybe this platform dependency is a feature - have not looked it up.
The text was updated successfully, but these errors were encountered:
mkristian
added a commit
to jruby/maven-tools
that referenced
this issue
Oct 17, 2014
the following script t.rb:
gives an
Encoding::UndefinedConversionError: ""\xC4\x81"" from UTF-8 to US-ASCII
error when executed likes thisversion jruby-1.7.8 and before as well as MRI works like this:
the same way as
the problem causes problems with jruby/rubygems-servlets#5 since the behaviour of StringIO#<< seems to be platform dependent in the sense it depends on platform encoding. maybe this platform dependency is a feature - have not looked it up.
The text was updated successfully, but these errors were encountered: