esnme/ultrajson — pull request #70 by benjamn (2013-01-10 04:04:12+00:00)
Title: Replace '<', '>', and '&' characters with unicode escape sequences

This mimics the behavior of simplejson.encode.JSONEncoderForHTML:
https://code.google.com/p/simplejson/source/browse/trunk/simplejson/encoder.py#287

I was considering using simplejson instead of ujson after reading
http://stackoverflow.com/a/7801710/128454, but then I realized I could
patch ujson just as easily!

Implementation:

'&' encodes to "\u0026"
'<' encodes to "\u003c"
'>' encodes to "\u003e"

Works for both ascii and non-ascii code paths (see tests).

Feedback welcome!