Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.3.1
-
Fix Version/s: None
-
Component/s: Core Classes/Modules, Java Integration
-
Labels:None
-
Number of attachments :
Description
Reproduce the bug with
import org.jruby.Ruby; import org.jruby.RubyString; public class MyTest { public static String hello(String name) { Ruby r = (Ruby)Ruby.getDefaultInstance(); return r.newString("Hello " + name).toString(); } }
and a test file (to prevent shell funkiness)
spinäl
jruby -e "require 'rubygems' ; include_class 'MyTest' ; p MyTest.hello(IO.readlines('test_file.txt').first)"
Run with jruby 1.1.6, the correct result is
"Hello spin\303\244l"
Run with jruby 1.3.1, the utf-8 characters are incorrectly unicoded as well
"Hello spin\303\203\302\244l"
The commit that introduced the bug http://github.com/jruby/jruby/commit/4f4595e09bcfd817a64c41b4badff5f8ebf3aa4f
This bug is related to http://jira.codehaus.org/browse/JRUBY-3732