mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
- 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)
This commit is contained in:
parent
b6568b91fd
commit
974ed7cfa5
11 changed files with 683 additions and 459 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue