rails/rails — pull request #10534 by cmaruz (2013-05-09 12:47:37+00:00)
Title: Escape of U+2028 and U+2029 in the JSON Encoder

U+2028 and U+2029 are allowed inside strings in JSON (as all literal
Unicode characters) but JavaScript defines them as newline
seperators. Because no literal newlines are allowed in a string, this
causes a ParseError in the browser. We work around this issue by
replacing them with the escaped version. The resulting JSON is still
valid and can be parsed in the browser.

This commit has been coauthored with Viktor Kelemen @yikulju

References:
- http://timelessrepo.com/json-isnt-a-javascript-subset
- https://github.com/rails/rails/issues/10320