Project

General

Profile

Actions

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 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"'
>>>

Updated by Alan Kennedy over 15 years ago ยท 1 revisions