RubyString incorrect handling of utf-8
--------------------------------------

                 Key: JRUBY-3813
                 URL: http://jira.codehaus.org/browse/JRUBY-3813
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Java Integration
    Affects Versions: JRuby 1.3.1
            Reporter: Thomas Olausson


Reproduce the bug with

{code}
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();
  }
}
{code}

and a test file (to prevent shell funkiness)
{code}
spinäl
{code}

{{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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to