Created
July 7, 2014 07:36
-
-
Save JordanMilne/0880a229356b317f9ee0 to your computer and use it in GitHub Desktop.
JSON_HEX_TAGS-like functionality
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import simplejson | |
>>> print simplejson.dumps({"foo<>":"<>bar&"}, cls=simplejson.JSONEncoderForHTML) | |
{"foo\u003c\u003e": "\u003c\u003ebar\u0026"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment