Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3578b77

Browse files
committed
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().
1 parent 265a804 commit 3578b77

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Doc/ext/ext.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,10 @@ \section{Format Strings for \cfunction{PyArg_ParseTuple()}
692692
This variant on \samp{s} stores into two C variables, the first one a
693693
pointer to a character string, the second one its length. In this
694694
case the Python string may contain embedded null bytes. Unicode
695-
objects and all other read buffer compatible objects pass back a
696-
reference to the raw internal data representation. In case of Unicode
697-
objects the pointer points to a null-terminated buffer of 16-bit
698-
Py_UNICODE (UTF-16) data.
695+
objects pass back a pointer to the default encoded string version of the
696+
object if such a conversion is possible. All other read buffer
697+
compatible objects pass back a reference to the raw internal data
698+
representation.
699699

700700
\item[\samp{z} (string or \code{None}) {[char *]}]
701701
Like \samp{s}, but the Python object may also be \code{None}, in which

0 commit comments

Comments
 (0)