From 7876125a22a3b54dbb3e7e830bcee554f2c91144 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Mon, 30 Sep 2013 08:46:35 +0300 Subject: [PATCH] Document s% and s# for json_pack, s% for json_unpack --- doc/apiref.rst | 16 ++++++++++++++++ doc/conformance.rst | 11 ++--------- 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