-
Notifications
You must be signed in to change notification settings - Fork 2
JysonEncodeOptions
amak edited this page Aug 19, 2024
·
1 revision
Jyson has a single option whch controls the output character set of the encoding operation: emit_ascii. If this option is true, then all characters with a Unicode value above 127 will be encoded as Unicode escapes. If the option is false, then a standard java Unicode string will be returned. The default value for the emit_ascii option is False. The following snippet illustrates the principle
>>> from com.xhaus.jyson import JysonCodec as json
>>> s = u"Al\u00e1in"
>>> json.dumps(s)
u'"Al\xe1in"'
>>> json.dumps(s, emit_ascii=True)
u'"Al\\u00E1in"'
>>>