place-marker/rails — pull request #2 by ahegyi (2014-12-03 01:32:33+00:00)
Title: Pass through Unicode characters in JSON string encoding

This "revert of a revert" will put the following commit back into effect: 815a9431ab61376a7e8e1bdff21f87bc557992f8

The reasoning behind that commit is copied here:

```
The encoding scheme (e.g. ☠ -> "\u2620") was broken for characters
not in the Basic Multilingual Plane. It is possible to escape them
for json using the weird encoding scheme of a twelve-character
sequence representing the UTF-16 surrogate pair (e.g. '𠜎' ->
"\u270e\u263a") but this wasn't properly handled in the escaping code.
Since raw UTF-8 is allowed in json, it was decided to simply pass
through the raw bytes rather than attempt to escape them.
```

We are doing this to enable emoji support, but on a broader level we believe JSON text should be UTF-8 (see json.org)

This issue should be fixed in Rails 4 - see http://stackoverflow.com/a/18456244