jsonyx.allow.SURROGATES¶
- jsonyx.allow.SURROGATES = frozenset({'surrogates'})¶
Allow unpaired surrogates in strings.
>>> import jsonyx as json >>> import jsonyx.allow >>> json.loads('"\ud800"', allow=jsonyx.allow.SURROGATES) '\ud800' >>> json.dump("\ud800", allow=jsonyx.allow.SURROGATES, ensure_ascii=True) "\ud800"
Tip
If you’re not using
read()orwrite(), you still need to useensure_ascii=Trueor set the unicode error handler to"surrogatepass".