doc: Enhance string overview

This commit is contained in:
Petri Lehtinen 2014-07-21 08:15:34 +03:00
parent abd151f5d7
commit a6229a2d3e

View File

@ -297,18 +297,16 @@ String
====== ======
Jansson uses UTF-8 as the character encoding. All JSON strings must be Jansson uses UTF-8 as the character encoding. All JSON strings must be
valid UTF-8 (or ASCII, as it's a subset of UTF-8). Normal null valid UTF-8 (or ASCII, as it's a subset of UTF-8). All Unicode
terminated C strings are used, so JSON strings may not contain codepoints U+0000 through U+10FFFF are allowed, but you must use
embedded null characters. All other Unicode codepoints U+0000 through length-aware functions if you wish to embed NUL bytes in strings.
U+10FFFF are allowed, but you must use length-aware functions if you
wish to embed NUL bytes in strings.
.. function:: json_t *json_string(const char *value) .. function:: json_t *json_string(const char *value)
.. refcounting:: new .. refcounting:: new
Returns a new JSON string, or *NULL* on error. *value* must be a Returns a new JSON string, or *NULL* on error. *value* must be a
valid UTF-8 encoded Unicode string. valid null terminated UTF-8 encoded Unicode string.
.. function:: json_t *json_stringn(const char *value, size_t len) .. function:: json_t *json_stringn(const char *value, size_t len)