Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dbackeus
Created December 13, 2012 17:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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