aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2013-09-30 08:46:35 +0300
committerPetri Lehtinen <petri@digip.org>2013-09-30 08:47:05 +0300
commit7876125a22a3b54dbb3e7e830bcee554f2c91144 (patch)
tree1ada85a94771897021e612e524e0bac54879d742
parente2dcf94598c72ac120ed1bfed5744410619d4bd9 (diff)
downloadjansson-7876125a22a3b54dbb3e7e830bcee554f2c91144.zip
jansson-7876125a22a3b54dbb3e7e830bcee554f2c91144.tar.gz
jansson-7876125a22a3b54dbb3e7e830bcee554f2c91144.tar.bz2
Document s% and s# for json_pack, s% for json_unpack
-rw-r--r--doc/apiref.rst16
-rw-r--r--doc/conformance.rst11
2 files changed, 18 insertions, 9 deletions
diff --git a/doc/apiref.rst b/doc/apiref.rst
index ad13481..08c2946 100644
--- a/doc/apiref.rst
+++ b/doc/apiref.rst
@@ -1113,6 +1113,11 @@ arguments.
.. versionadded:: 2.5
+``s%`` (string) [const char \*, size_t]
+ Like ``s#`` but the length argument is of type :type:`size_t`.
+
+ .. versionadded:: 2.6
+
``+`` [const char \*]
Like ``s``, but concatenate to the previous string. Only valid
after ``s``, ``s#``, ``+`` or ``+#``.
@@ -1125,6 +1130,11 @@ arguments.
.. versionadded:: 2.5
+``+%`` (string) [const char \*, size_t]
+ Like ``+#`` but the length argument is of type :type:`size_t`.
+
+ .. versionadded:: 2.6
+
``n`` (null)
Output a JSON null value. No argument is consumed.
@@ -1239,6 +1249,12 @@ type whose address should be passed.
:func:`json_string_value()` internally, so it exists as long as
there are still references to the corresponding JSON string.
+``s%`` (string) [const char \*, size_t *]
+ Convert a JSON string to a pointer to a NULL terminated UTF-8
+ string and its length.
+
+ .. versionadded:: 2.6
+
``n`` (null)
Expect a JSON null value. Nothing is extracted.
diff --git a/doc/conformance.rst b/doc/conformance.rst
index 19f603d..09ada0e 100644
--- a/doc/conformance.rst
+++ b/doc/conformance.rst
@@ -19,15 +19,8 @@ Strings
=======
JSON strings are mapped to C-style null-terminated character arrays,
-and UTF-8 encoding is used internally. Strings may not contain
-embedded null characters, not even escaped ones.
-
-For example, trying to decode the following JSON text leads to a parse
-error::
-
- ["this string contains the null character: \u0000"]
-
-All other Unicode codepoints U+0001 through U+10FFFF are allowed.
+and UTF-8 encoding is used internally. All Unicode codepoints U+0000
+through U+10FFFF are allowed.
Unicode normalization or any other transformation is never performed
on any strings (string values or object keys). When checking for