summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-06-02 16:49:17 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-06-02 16:49:17 (GMT)
commit974ed7cfa50b666c9ab91f7a3f8f26049d387107 (patch)
treed821c74c26231d988f34764d0fdfe3494036ee95 /Doc
parentb6568b91fdf7de1377dba395c6725a7307b818ee (diff)
downloadcpython-974ed7cfa50b666c9ab91f7a3f8f26049d387107.zip
cpython-974ed7cfa50b666c9ab91f7a3f8f26049d387107.tar.gz
cpython-974ed7cfa50b666c9ab91f7a3f8f26049d387107.tar.bz2
- 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)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/api/concrete.tex9
-rw-r--r--Doc/lib/libstdtypes.tex11
2 files changed, 20 insertions, 0 deletions
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 @@ functions depending on the Python configuration.
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 @@ use these APIs:
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 @@ Return true if all cased characters in the string are uppercase and
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 @@ character mapping codec using the \refmodule{codecs} module (see
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