Skip to content

Instantly share code, notes, and snippets.

@JordanMilne
Created July 7, 2014 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JordanMilne/0880a229356b317f9ee0 to your computer and use it in GitHub Desktop.
Save JordanMilne/0880a229356b317f9ee0 to your computer and use it in GitHub Desktop.
JSON_HEX_TAGS-like functionality
>>> 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