diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-08-22 17:03:25 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-08-22 17:03:25 (GMT) |
commit | 8c9375bb5996417f737e63f5080fc8b6eb886a77 (patch) | |
tree | 3b6bf8c1b1984a0c952768631b41e7b36f65642b /Doc | |
parent | 3d1706fa83be3d60562098a9e86eb1f8f778a35c (diff) | |
download | cpython-8c9375bb5996417f737e63f5080fc8b6eb886a77.zip cpython-8c9375bb5996417f737e63f5080fc8b6eb886a77.tar.gz cpython-8c9375bb5996417f737e63f5080fc8b6eb886a77.tar.bz2 |
#10542: Add 4 macros to work with surrogates: Py_UNICODE_IS_SURROGATE, Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE, Py_UNICODE_JOIN_SURROGATES.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/unicode.rst | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index a69757b..e635514 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -195,6 +195,27 @@ These APIs can be used for fast direct character conversions: possible. This macro does not raise exceptions. +These APIs can be used to work with surrogates: + +.. c:macro:: Py_UNICODE_IS_SURROGATE(ch) + + Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``). + +.. c:macro:: Py_UNICODE_IS_HIGH_SURROGATE(ch) + + Check if *ch* is an high surrogate (``0xD800 <= ch <= 0xDBFF``). + +.. c:macro:: Py_UNICODE_IS_LOW_SURROGATE(ch) + + Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``). + +.. c:macro:: Py_UNICODE_JOIN_SURROGATES(high, low) + + Join two surrogate characters and return a single Py_UCS4 value. + *high* and *low* are respectively the leading and trailing surrogates in a + surrogate pair. + + Plain Py_UNICODE """""""""""""""" |