Skip to content

Commit

Permalink
Implement work around for rbx encoding problem
Browse files Browse the repository at this point in the history
  • Loading branch information
flori committed May 11, 2012
1 parent 998d5cd commit fde9036
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fde9036

Please sign in to comment.