summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-05 12:00:46 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-05 12:00:46 (GMT)
commitacaa5a16d6cd9a94e7e111761264eef14a033d2c (patch)
treec2c2156bc64012da26a254caebdaf1a35b96f706 /Doc/api
parent1255ed62bfc2f9f8f5c50935c21cbe0a34e12cc7 (diff)
downloadcpython-acaa5a16d6cd9a94e7e111761264eef14a033d2c.zip
cpython-acaa5a16d6cd9a94e7e111761264eef14a033d2c.tar.gz
cpython-acaa5a16d6cd9a94e7e111761264eef14a033d2c.tar.bz2
Add PyUnicode_FromString(), which create a unicode object from a
const char * (i.e. 0-terminated latin-1 encoded bytes).
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/concrete.tex11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/api/concrete.tex b/Doc/api/concrete.tex
index cdf6856..e1ab3ec 100644
--- a/Doc/api/concrete.tex
+++ b/Doc/api/concrete.tex
@@ -995,6 +995,17 @@ use these APIs:
\var{u} is \NULL{}.
\end{cfuncdesc}
+\begin{cfuncdesc}{PyObject*}{PyUnicode_FromString}{const char *u}
+ Create a Unicode Object from the char buffer \var{u} of the.
+ \var{u} must be 0-terminated, the bytes will be interpreted as
+ being latin-1 encoded. \var{u} may also be \NULL{} which causes the
+ contents to be undefined. It is the user's responsibility to fill
+ in the needed data. The buffer is copied into the new object.
+ If the buffer is not \NULL{}, the return value might be a shared object.
+ Therefore, modification of the resulting Unicode object is only allowed
+ when \var{u} is \NULL{}.
+\end{cfuncdesc}
+
\begin{cfuncdesc}{Py_UNICODE*}{PyUnicode_AsUnicode}{PyObject *unicode}
Return a read-only pointer to the Unicode object's internal
\ctype{Py_UNICODE} buffer, \NULL{} if \var{unicode} is not a Unicode