#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
-#define NEEDS_PY_IDENTIFIER
#define PY_SSIZE_T_CLEAN
#include <stdbool.h>
-_Py_IDENTIFIER(NFC);
-_Py_IDENTIFIER(NFD);
-_Py_IDENTIFIER(NFKC);
-_Py_IDENTIFIER(NFKD);
-
/*[clinic input]
module unicodedata
class unicodedata.UCD 'PreviousDBVersion *' '<not used>'
PyObject *cmp;
int match = 0;
- if (_PyUnicode_EqualToASCIIId(form, &PyId_NFC)) {
+ if (PyUnicode_CompareWithASCIIString(form, "NFC") == 0) {
nfc = true;
}
- else if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKC)) {
+ else if (PyUnicode_CompareWithASCIIString(form, "NFKC") == 0) {
nfc = true;
k = true;
}
- else if (_PyUnicode_EqualToASCIIId(form, &PyId_NFD)) {
+ else if (PyUnicode_CompareWithASCIIString(form, "NFD") == 0) {
/* matches default values for `nfc` and `k` */
}
- else if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKD)) {
+ else if (PyUnicode_CompareWithASCIIString(form, "NFKD") == 0) {
k = true;
}
else {
return input;
}
- if (_PyUnicode_EqualToASCIIId(form, &PyId_NFC)) {
+ if (PyUnicode_CompareWithASCIIString(form, "NFC") == 0) {
if (is_normalized_quickcheck(self, input,
true, false, true) == YES) {
Py_INCREF(input);
}
return nfc_nfkc(self, input, 0);
}
- if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKC)) {
+ if (PyUnicode_CompareWithASCIIString(form, "NFKC") == 0) {
if (is_normalized_quickcheck(self, input,
true, true, true) == YES) {
Py_INCREF(input);
}
return nfc_nfkc(self, input, 1);
}
- if (_PyUnicode_EqualToASCIIId(form, &PyId_NFD)) {
+ if (PyUnicode_CompareWithASCIIString(form, "NFD") == 0) {
if (is_normalized_quickcheck(self, input,
false, false, true) == YES) {
Py_INCREF(input);
}
return nfd_nfkd(self, input, 0);
}
- if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKD)) {
+ if (PyUnicode_CompareWithASCIIString(form, "NFKD") == 0) {
if (is_normalized_quickcheck(self, input,
false, true, true) == YES) {
Py_INCREF(input);