1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-06-03 15:46:05 +02:00

Stupid RST fixed

This commit is contained in:
jtarnstrom 2013-02-18 18:19:39 +01:00
parent a55ba621ce
commit cbaf644b23

View File

@ -1,4 +1,4 @@
UltraJSON
UltraJSON
=============
UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 2.5+ and 3.
@ -17,28 +17,28 @@ May be used as a drop in replacement for most other JSON parsers for Python::
>>> ujson.loads("""[{"key": "value"}, 81, true]""")
[{u'key': u'value'}, 81, True]
~~~~~~~~~~~~~
~~~~~~~~~~~~~~~
Encoder options
~~~~~~~~~~~~~
~~~~~~~~~~~~~~~
encode_html_chars
-----------------
Used to enable special encoding of "unsafe" HTML characters into safer Unicode sequences. Default is false
Used to enable special encoding of "unsafe" HTML characters into safer Unicode sequences. Default is false::
>>> ujson.dumps("<script>John&Doe", encode_html_chars=True)
'"\\u003cscript\\u003eJohn\\u0026Doe"'
ensure_ascii
-------------
Limits output to ASCII and escapes all extended characters above 127. Default is true. If your end format supports UTF-8 setting this optino to false is highly recommended to save space.
Limits output to ASCII and escapes all extended characters above 127. Default is true. If your end format supports UTF-8 setting this optino to false is highly recommended to save space::
>>> ujson.dumps(u"åäö", ensure_ascii=True)
>>> ujson.dumps(u"\xe5\xe4\xf6")
'"\\u00e5\\u00e4\\u00f6"'
>>> ujson.dumps(u"åäö", ensure_ascii=False)
>>> ujson.dumps(u"\xe5\xe4\xf6", ensure_ascii=False)
'"\xc3\xa5\xc3\xa4\xc3\xb6"'
double_precision
----------------
Controls how many decimals to encode for double or decimal values. Default is 9.
Controls how many decimals to encode for double or decimal values. Default is 9::
>>> ujson.dumps(math.pi)
'3.1415926536'
@ -54,7 +54,7 @@ Decoders options
~~~~~~~~~~~~~~~~
precise_float
-------------
Set to enable usage of higher precision (strtod) function when decoding string to double values. Default is to use fast but less precise builtin functionality.
Set to enable usage of higher precision (strtod) function when decoding string to double values. Default is to use fast but less precise builtin functionality::
>>> ujson.loads("4.56")
4.5600000000000005