multi-byte character encoding probrem 
--------------------------------------

                 Key: JRUBY-1576
                 URL: http://jira.codehaus.org/browse/JRUBY-1576
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.0.1
            Reporter: Masahito Henmi


I found a multi-byte character encoding probrem.

The probrem case:

     BSFManager manager = new BSFManager();

     String japaneseHiragana = "'\u3042\u3044\u3046'"; // HIRAGANA A I U

     Object ans = manager.eval("ruby", "(java)", 1, 1, japaneseHiragana);

     System.out.println("ans = " + ans);

Result:      BDF


BEFORE =============== ByteList.java

119:    public ByteList append(int b) {
120:        append((byte)b);
121:        return this;
122:    }

AFTER ================ ByteList.java

    public ByteList append(int b) {
        String wk = new String(new char[]{(char) b});

        byte[] byArr = null;
        try {
              byArr = wk.getBytes("UTF8");
        } catch (Exception ex) {
               throw new RuntimeException(ex); // ??
        }
           
        for (int i = 0; i < byArr.length; i++) {
              append(byArr[i]);
        }
        return this;
    }


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