mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-110289: C API: Add PyUnicode_EqualToUTF8() and PyUnicode_EqualToUTF8AndSize() functions (GH-110297)
This commit is contained in:
parent
d1f7fae424
commit
eb50cd37ea
11 changed files with 280 additions and 0 deletions
|
@ -957,6 +957,15 @@ PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
|
|||
const char *right /* ASCII-encoded string */
|
||||
);
|
||||
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000
|
||||
/* Compare a Unicode object with UTF-8 encoded C string.
|
||||
Return 1 if they are equal, or 0 otherwise.
|
||||
This function does not raise exceptions. */
|
||||
|
||||
PyAPI_FUNC(int) PyUnicode_EqualToUTF8(PyObject *, const char *);
|
||||
PyAPI_FUNC(int) PyUnicode_EqualToUTF8AndSize(PyObject *, const char *, Py_ssize_t);
|
||||
#endif
|
||||
|
||||
/* Rich compare two strings and return one of the following:
|
||||
|
||||
- NULL in case an exception was raised
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue