Closed msroot closed 7 years ago
Thank you for the pull request! What version of ActiveSupport are you using? Does that problem exist in later Ruby versions?
Hi I am using activesupport 3.2.22.5
json = MultiJson.dump(payload)
[2, json.bytes.count, json].pack('cna*')
=> "\x02\x00o{\"aps\":{\"alert\":\"Workin? ---> \xF0\x9F\x92\xAC \xE2\x9D\xA4\xEF\xB8\x8F \xF0\x9F\x8E\xB6 \xF0\x9F\x8E\xB6 \xF0\x9F\x8E\xB6\",\"badge\":0,\"content-available\":1,\"mutable-content\":1}}"
json = payload.to_json
[2, json.bytes.count, json].pack('cna*')
=> "\x02\x00}{\"aps\":{\"alert\":\"Workin? ---> \\uf4ac \\u2764\\ufe0f \\uf3b6 \\uf3b6 \\uf3b6\",\"badge\":0,\"content-available\":1,\"mutable-content\":1}}"
@msroot Can you upgrade your app to Rails 4.2 or 5 (and Ruby 2.2 or later)? That issue should have been fixed in those versions of ActiveSupport. Rails 3 is no longer maintained and there aren't any goals to support it in houston. And I also think that this is not the responsibility of the gem to take care of all possible overrides by other libraries.
This is the output from ActiveSupport 5.0.2:
>> "💬".to_json
=> "\"💬\""
When i use
houston
withActiveSupport
theActiveSupport::JSON
to_json
will overwrite theJSON
'sto_json
method and Emojis doent display rightexample with ActiveSupport::JSON:
example with JSON: