Skip to content

Commit 7ab08d2

Browse files
[3.14] gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions (GH-141019) (GH-141027)
gh-141004: Document `Py_UNICODE_{HIGH, LOW}_SURROGATE` functions (GH-141019) (cherry picked from commit bfe5481) Co-authored-by: Stan Ulbrych <[email protected]>
1 parent dc76de2 commit 7ab08d2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Doc/c-api/unicode.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,22 @@ These APIs can be used to work with surrogates:
305305
306306
Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``).
307307
308+
.. c:function:: Py_UCS4 Py_UNICODE_HIGH_SURROGATE(Py_UCS4 ch)
309+
310+
Return the high UTF-16 surrogate (``0xD800`` to ``0xDBFF``) for a Unicode
311+
code point in the range ``[0x10000; 0x10FFFF]``.
312+
313+
.. c:function:: Py_UCS4 Py_UNICODE_LOW_SURROGATE(Py_UCS4 ch)
314+
315+
Return the low UTF-16 surrogate (``0xDC00`` to ``0xDFFF``) for a Unicode
316+
code point in the range ``[0x10000; 0x10FFFF]``.
317+
308318
.. c:function:: Py_UCS4 Py_UNICODE_JOIN_SURROGATES(Py_UCS4 high, Py_UCS4 low)
309319
310320
Join two surrogate code points and return a single :c:type:`Py_UCS4` value.
311321
*high* and *low* are respectively the leading and trailing surrogates in a
312-
surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must
313-
be in the range [0xDC00; 0xDFFF].
322+
surrogate pair. *high* must be in the range ``[0xD800; 0xDBFF]`` and *low* must
323+
be in the range ``[0xDC00; 0xDFFF]``.
314324
315325
316326
Creating and accessing Unicode strings

0 commit comments

Comments
 (0)