Skip to content

Instantly share code, notes, and snippets.

@dbackeus
Created December 13, 2012 17:11
Show Gist options
  • Save dbackeus/4278031 to your computer and use it in GitHub Desktop.
Save dbackeus/4278031 to your computer and use it in GitHub Desktop.
Spec to confirm monkey patch still necessary for: https://github.com/rails/rails/issues/3727
# Encoding: UTF-8
require 'spec_helper'
# Specs for initializers/patches.rb
describe ActiveSupport::JSON::Encoding do
it "should not break high bitrate utf-8 characters" do
hash = { string: "๐’‘" }
json = ActiveSupport::JSON.encode(hash)
decoded_hash = ActiveSupport::JSON.decode(json)
decoded_hash['string'].should == "๐’‘"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment