Skip to content
amak edited this page Aug 19, 2024 · 1 revision

Options for controlling the jyson encoding process.

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"'
>>>
Clone this wiki locally