Commit 3578b773 authored by Marc-André Lemburg's avatar Marc-André Lemburg

Special case the "s#" PyArg_Parse() token for Unicode objects:

"s#" will now return a pointer to the default encoded string data
of the Unicode object instead of a pointer to the raw UTF-16
data.

The latter is still available via PyObject_AsReadBuffer().
parent 265a804a
...@@ -692,10 +692,10 @@ raised. ...@@ -692,10 +692,10 @@ raised.
This variant on \samp{s} stores into two C variables, the first one a This variant on \samp{s} stores into two C variables, the first one a
pointer to a character string, the second one its length. In this pointer to a character string, the second one its length. In this
case the Python string may contain embedded null bytes. Unicode case the Python string may contain embedded null bytes. Unicode
objects and all other read buffer compatible objects pass back a objects pass back a pointer to the default encoded string version of the
reference to the raw internal data representation. In case of Unicode object if such a conversion is possible. All other read buffer
objects the pointer points to a null-terminated buffer of 16-bit compatible objects pass back a reference to the raw internal data
Py_UNICODE (UTF-16) data. representation.
\item[\samp{z} (string or \code{None}) {[char *]}] \item[\samp{z} (string or \code{None}) {[char *]}]
Like \samp{s}, but the Python object may also be \code{None}, in which Like \samp{s}, but the Python object may also be \code{None}, in which
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment