Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.5.1
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
    • Number of attachments :
      2

      Description

      The latest git version (1f0e0d1f7dc09580d1d287799997a437a34f5684),
      Jruby don't work with EUC-JP Linux locale. See below:

      % LANG=ja_JP.utf8 jirb
      irb(main):001:0>
      % LANG=ja_JP.eucJP jirb
      OSEnvironment.java:81:in `getAsMapOfRubyStrings': java.lang.NullPointerException
              from OSEnvironment.java:60:in `getEnvironmentVariableMap'
              from RubyGlobal.java:300:in `defineGlobalEnvConstants'
              from RubyGlobal.java:277:in `createGlobals'
              from Ruby.java:1080:in `init'
              from Ruby.java:173:in `newInstance'
              from Main.java:217:in `run'
              from Main.java:128:in `run'
              from Main.java:97:in `main'
      

      I found that problem caused by getAsMapOfRubyStrings() method in OSEnvironment.java.

             Map envs = new HashMap();
             Encoding encoding = EncodingDB.getEncodings().get(Charset.defaultCharset().name().getBytes()).getEncoding();
             ...
      

      [debug]
      0. LANG=ja_JP.eucJP
      1. Charset.defaultCharset().name() => "x-euc-jp-linux".(#1)
      2. EncodingDB.getEncodings().get("x-euc-jp-linux") => null
      3. NullPointerException

      #1: http://java.sun.com/javase/6/docs/technotes/guides/intl/encoding.doc.html

      1. add_alias_lookup_to_jruby.patch
        1 kB
        Masayuki Onjo
      2. add_alias_to_jcodings.patch
        0.6 kB
        Masayuki Onjo

        Activity

        Hide
        Masayuki Onjo added a comment -

        quick patch (works for me)

        Show
        Masayuki Onjo added a comment - quick patch (works for me)
        Hide
        Hiro Asari added a comment -

        This appears to work now on master.

        Show
        Hiro Asari added a comment - This appears to work now on master.

          People

          • Assignee:
            Unassigned
            Reporter:
            Masayuki Onjo
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: