Always escape U+2028 and U+2029 to be nice to broken JSON parsers

Description

U+2028 and U+2029 should be treated like \n and, viz, escaped even when *escape-unicode* is false.

A number of JSON parsers (such as ExtJS's) think they can eval JSON in a JS runtime to decode it. This is not true, since JS does not allow U+2028 and U+2029 unescaped in strings:

http://timelessrepo.com/json-isnt-a-javascript-subset

While this is broken behavior, it is also quite common, so escaping these characters uniformly may ease some developer pain and surprise.

Environment

None

Attachments

1

Activity

Show:

Stuart Sierra January 10, 2014 at 5:10 PM

Marking old issues as 'closed'

Stuart Sierra August 2, 2013 at 9:25 PM

Reimplemented as an additional optional argument on master.

Tim McCormack [personal] April 29, 2013 at 3:46 AM

Attached patch.

Completed

Details

Assignee

Reporter

Priority

Created April 29, 2013 at 3:45 AM
Updated January 10, 2014 at 5:10 PM
Resolved January 10, 2014 at 5:10 PM