#1945: document Unicode functions backported from py3k branch.
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index e7e5b47..fc9368d 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -220,6 +220,111 @@
changes in your code for properly supporting 64-bit systems.
+.. cfunction:: PyObject* PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size)
+
+ Create a Unicode Object from the char buffer *u*. The bytes will be interpreted
+ as being UTF-8 encoded. *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 *u* is *NULL*.
+
+ .. versionadded:: 2.6
+
+
+.. cfunction:: PyObject *PyUnicode_FromString(const char *u)
+
+ Create a Unicode object from an UTF-8 encoded null-terminated char buffer
+ *u*.
+
+ .. versionadded:: 2.6
+
+
+.. cfunction:: PyObject* PyUnicode_FromFormat(const char *format, ...)
+
+ Take a C :cfunc:`printf`\ -style *format* string and a variable number of
+ arguments, calculate the size of the resulting Python unicode string and return
+ a string with the values formatted into it. The variable arguments must be C
+ types and must correspond exactly to the format characters in the *format*
+ string. The following format characters are allowed:
+
+ .. % The descriptions for %zd and %zu are wrong, but the truth is complicated
+ .. % because not all compilers support the %z width modifier -- we fake it
+ .. % when necessary via interpolating PY_FORMAT_SIZE_T.
+
+ +-------------------+---------------------+--------------------------------+
+ | Format Characters | Type | Comment |
+ +===================+=====================+================================+
+ | :attr:`%%` | *n/a* | The literal % character. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%c` | int | A single character, |
+ | | | represented as an C int. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%d` | int | Exactly equivalent to |
+ | | | ``printf("%d")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%u` | unsigned int | Exactly equivalent to |
+ | | | ``printf("%u")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%ld` | long | Exactly equivalent to |
+ | | | ``printf("%ld")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%lu` | unsigned long | Exactly equivalent to |
+ | | | ``printf("%lu")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%zd` | Py_ssize_t | Exactly equivalent to |
+ | | | ``printf("%zd")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%zu` | size_t | Exactly equivalent to |
+ | | | ``printf("%zu")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%i` | int | Exactly equivalent to |
+ | | | ``printf("%i")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%x` | int | Exactly equivalent to |
+ | | | ``printf("%x")``. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%s` | char\* | A null-terminated C character |
+ | | | array. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%p` | void\* | The hex representation of a C |
+ | | | pointer. Mostly equivalent to |
+ | | | ``printf("%p")`` except that |
+ | | | it is guaranteed to start with |
+ | | | the literal ``0x`` regardless |
+ | | | of what the platform's |
+ | | | ``printf`` yields. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%U` | PyObject\* | A unicode object. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%V` | PyObject\*, char \* | A unicode object (which may be |
+ | | | *NULL*) and a null-terminated |
+ | | | C character array as a second |
+ | | | parameter (which will be used, |
+ | | | if the first parameter is |
+ | | | *NULL*). |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%S` | PyObject\* | The result of calling |
+ | | | :func:`PyObject_Unicode`. |
+ +-------------------+---------------------+--------------------------------+
+ | :attr:`%R` | PyObject\* | The result of calling |
+ | | | :func:`PyObject_Repr`. |
+ +-------------------+---------------------+--------------------------------+
+
+ An unrecognized format character causes all the rest of the format string to be
+ copied as-is to the result string, and any extra arguments discarded.
+
+ .. versionadded:: 2.6
+
+
+.. cfunction:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)
+
+ Identical to :func:`PyUnicode_FromFormat` except that it takes exactly two
+ arguments.
+
+ .. versionadded:: 2.6
+
+
.. cfunction:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
Return a read-only pointer to the Unicode object's internal :ctype:`Py_UNICODE`