JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6501

warning: variable $KCODE is no longer effective on github master JRuby (1.9 mode)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Windows
    • Labels:
      None
    • Environment:
      jruby 1.7.0.dev (ruby-1.9.3-p139) (2012-02-27 fffffff) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_02) [Windows 7-amd64-java] 
    • Number of attachments :
      0

      Description

      Hi.

      When I tried latest JRuby (github master / 1.9 mode) on windows box recently, the following warning about character encoding has occurred.

      >bin\jruby --version
      jruby 1.7.0.dev (ruby-1.9.3-p139) (2012-02-27 fffffff) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_02) [Windows 7-amd64-java]
      >bin\jruby -e "puts :foo"
      (snip)/git-repos/jruby/lib/ruby/shared/Win32API.rb:7 warning: warning: variable $KCODE is no longer effective
      foo

      $KCODE is no longer effective, Encoding.default_internal should be used instead of the $KCODE.

      Thanks

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        So, this warning also appears in MRI 1.9.3, but I feel like I'm seeing it more than I should. I'm guessing it's a simple matter of Win32API using $KCODE when it should not. Will look into that.

        Show
        Charles Oliver Nutter added a comment - So, this warning also appears in MRI 1.9.3, but I feel like I'm seeing it more than I should. I'm guessing it's a simple matter of Win32API using $KCODE when it should not. Will look into that.
        Hide
        Charles Oliver Nutter added a comment -

        I audited the JRuby codebase and found only two unguarded uses of $KCODE, in lib/ruby/shared/Win32API.rb and samples/ffi/win32api.rb. I fixed both with a 1.9 guard and Encoding.default_internal, as described in the longer error message.

        This does not need to be ported to 1.6.x.

        commit 994d2cc97113cf4936509646a4fb806ef2ee19c4
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Mon Feb 27 08:40:00 2012 -0600
        
            Don't use $KCODE in 1.9 mode.
        
        Show
        Charles Oliver Nutter added a comment - I audited the JRuby codebase and found only two unguarded uses of $KCODE, in lib/ruby/shared/Win32API.rb and samples/ffi/win32api.rb. I fixed both with a 1.9 guard and Encoding.default_internal, as described in the longer error message. This does not need to be ported to 1.6.x. commit 994d2cc97113cf4936509646a4fb806ef2ee19c4 Author: Charles Oliver Nutter <headius@headius.com> Date: Mon Feb 27 08:40:00 2012 -0600 Don't use $KCODE in 1.9 mode.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Satoru Chinen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: