Skip to content

Warning in Win32api.rb - check fails in Ruby 2.0 mode #1499

@bryonb07

Description

@bryonb07

I'm using Torquebox, with JRuby 1.7.10 currently. When starting JRuby in 2.0 mode in Windows, I get the following warning:

jruby/lib/ruby/shared/Win32API.rb:11 warning: warning: variable $KCODE is no longer effective

The check on line 7 now fails in Ruby 2.0 mode, reverting to the old code:

if RUBY_VERSION =~ /1.9/
SUFFIXES = Encoding.default_internal == Encoding::UTF_8 ? [ '', 'W', 'A' ] : [ '', 'A', 'W' ]
else
SUFFIXES = $KCODE == 'UTF8' ? [ '', 'W', 'A' ] : [ '', 'A', 'W' ]
end

The same issue can be found in jruby/samples/ffi/Win32api.rb

The check needs to be updated to work with 1.9 or newer modes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions