Skip to content

Commit bfe5481

Browse files
gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions (GH-141019)
1 parent ce1bb85 commit bfe5481

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
@@ -321,12 +321,22 @@ These APIs can be used to work with surrogates:
321321
322322
Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``).
323323
324+
.. c:function:: Py_UCS4 Py_UNICODE_HIGH_SURROGATE(Py_UCS4 ch)
325+
326+
Return the high UTF-16 surrogate (``0xD800`` to ``0xDBFF``) for a Unicode
327+
code point in the range ``[0x10000; 0x10FFFF]``.
328+
329+
.. c:function:: Py_UCS4 Py_UNICODE_LOW_SURROGATE(Py_UCS4 ch)
330+
331+
Return the low UTF-16 surrogate (``0xDC00`` to ``0xDFFF``) for a Unicode
332+
code point in the range ``[0x10000; 0x10FFFF]``.
333+
324334
.. c:function:: Py_UCS4 Py_UNICODE_JOIN_SURROGATES(Py_UCS4 high, Py_UCS4 low)
325335
326336
Join two surrogate code points and return a single :c:type:`Py_UCS4` value.
327337
*high* and *low* are respectively the leading and trailing surrogates in a
328-
surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must
329-
be in the range [0xDC00; 0xDFFF].
338+
surrogate pair. *high* must be in the range ``[0xD800; 0xDBFF]`` and *low* must
339+
be in the range ``[0xDC00; 0xDFFF]``.
330340
331341
332342
Creating and accessing Unicode strings

0 commit comments

Comments
 (0)