From fde9036047e6d3e0771507a111f07793a7a26761 Mon Sep 17 00:00:00 2001 From: Florian Frank Date: Sat, 12 May 2012 00:00:04 +0200 Subject: Implement work around for rbx encoding problem --- lib/json/common.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/json/common.rb b/lib/json/common.rb index 05eaf26..3349501 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -405,7 +405,10 @@ module JSON 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) -- cgit v1.2.1