- SF #962502: Add two more methods for unicode type; width() and
iswide() for east asian width manipulation. (Inspired by David
Goodger, Reviewed by Martin v. Loewis)
- Move _PyUnicode_TypeRecord.flags to the end of the struct so that
no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)
diff --git a/Doc/api/concrete.tex b/Doc/api/concrete.tex
index eaa2d59..2c4d45f 100644
--- a/Doc/api/concrete.tex
+++ b/Doc/api/concrete.tex
@@ -850,6 +850,11 @@
   character.
 \end{cfuncdesc}
 
+\begin{cfuncdesc}{int}{Py_UNICODE_ISWIDE}{Py_UNICODE ch}
+  Returns 1/0 depending on whether \var{ch} is a wide or full-width
+  character.
+\end{cfuncdesc}
+
 These APIs can be used for fast direct character conversions:
 
 \begin{cfuncdesc}{Py_UNICODE}{Py_UNICODE_TOLOWER}{Py_UNICODE ch}
@@ -908,6 +913,10 @@
   Return the length of the Unicode object.
 \end{cfuncdesc}
 
+\begin{cfuncdesc}{int}{PyUnicode_GetWidth}{PyObject *unicode}
+  Return the fixed-width representation length of the Unicode object.
+\end{cfuncdesc}
+
 \begin{cfuncdesc}{PyObject*}{PyUnicode_FromEncodedObject}{PyObject *obj,
                                                       const char *encoding,
                                                       const char *errors}
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex
index ccb16c0..3526f95 100644
--- a/Doc/lib/libstdtypes.tex
+++ b/Doc/lib/libstdtypes.tex
@@ -642,6 +642,12 @@
 there is at least one cased character, false otherwise.
 \end{methoddesc}
 
+\begin{methoddesc}[string]{iswide}{}
+Return true if all characters in the string are wide or full width and
+there is at least one wide or full width character, false otherwise.
+This method is supported by unicode type only.
+\end{methoddesc}
+
 \begin{methoddesc}[string]{join}{seq}
 Return a string which is the concatenation of the strings in the
 sequence \var{seq}.  The separator between elements is the string
@@ -774,6 +780,11 @@
 Return a copy of the string converted to uppercase.
 \end{methoddesc}
 
+\begin{methoddesc}[string]{width}{}
+Return length of fixed-width representation of the string. This method
+is supported by unicode type only.
+\end{methoddesc}
+
 \begin{methoddesc}[string]{zfill}{width}
 Return the numeric string left filled with zeros in a string
 of length \var{width}. The original string is returned if