diff --git a/lib/json/common.rb b/lib/json/common.rb index 05eaf26f..33495013 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -405,7 +405,10 @@ def self.swap!(string) # :nodoc: end # Shortuct for iconv. - if ::String.method_defined?(:encode) + if ::String.method_defined?(:encode) && + # XXX Rubinius doesn't support ruby 1.9 encoding yet + defined?(RUBY_ENGINE) && RUBY_ENGINE != 'rbx' + then # Encodes string using Ruby's _String.encode_ def self.iconv(to, from, string) string.encode(to, from)