Permalink
Browse files

Implement work around for rbx encoding problem

  • Loading branch information...
flori committed May 11, 2012
1 parent 998d5cd commit fde9036047e6d3e0771507a111f07793a7a26761
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/json/common.rb
View
@@ -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)

0 comments on commit fde9036

Please sign in to comment.