Add 'U'/'U#' format characters to Py_BuildValue (and thus
to PyObject_CallFunction()) that take a char * (and a size
in the case of 'U#') and create a unicode object out of it.
Add functions PyUnicode_FromFormat() and PyUnicode_FromFormatV()
that work similar to PyString_FromFormat(), but create a unicode
object (also a %U format character has been added, that takes
a PyObject *, which must point to a unicode object).
Change the encoding and reason attributes of UnicodeEncodeError,
UnicodeDecodeError and UnicodeTranslateError to be unicode
objects.
diff --git a/Doc/api/utilities.tex b/Doc/api/utilities.tex
index fb9c909..968ce4f 100644
--- a/Doc/api/utilities.tex
+++ b/Doc/api/utilities.tex
@@ -848,6 +848,15 @@
to a Python Unicode object. If the Unicode buffer pointer
is \NULL, the length is ignored and \code{None} is returned.
+ \item[\samp{U} (string) {[char *]}]
+ Convert a null-terminated C string to a Python unicode object.
+ If the C string pointer is \NULL, \code{None} is used.
+
+ \item[\samp{U\#} (string) {[char *, int]}]
+ Convert a C string and its length to a Python unicode object.
+ If the C string pointer is \NULL, the length is ignored and \code{None}
+ is returned.
+
\item[\samp{i} (integer) {[int]}]
Convert a plain C \ctype{int} to a Python integer object.