diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-03-11 12:16:23 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-03-11 12:16:23 (GMT) |
commit | c3509129900e5446598569cc8c7e78e928000831 (patch) | |
tree | c698413ee6013c0d00cf0c9b964cd164158c9e3e /Modules | |
parent | 88ca467ca4b1f13a9fb172712cf25eeae94e3095 (diff) | |
download | cpython-c3509129900e5446598569cc8c7e78e928000831.zip cpython-c3509129900e5446598569cc8c7e78e928000831.tar.gz cpython-c3509129900e5446598569cc8c7e78e928000831.tar.bz2 |
Adjust CJK Ideograph range to Unicode 4.1.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/unicodedata.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index 5a4378b..9eda653 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -803,7 +803,7 @@ is_unified_ideograph(Py_UCS4 code) { return ( (0x3400 <= code && code <= 0x4DB5) || /* CJK Ideograph Extension A */ - (0x4E00 <= code && code <= 0x9FA5) || /* CJK Ideograph */ + (0x4E00 <= code && code <= 0x9FBB) || /* CJK Ideograph */ (0x20000 <= code && code <= 0x2A6D6));/* CJK Ideograph Extension B */ } @@ -815,6 +815,17 @@ _getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen) int word; unsigned char* w; + if (code >= 0x110000) + return 0; + + if (self) { + const change_record *old = get_old_record(self, code); + if (old->category_changed == 0) { + /* unassigned */ + return 0; + } + } + if (SBase <= code && code < SBase+SCount) { /* Hangul syllable. */ int SIndex = code - SBase; @@ -845,18 +856,6 @@ _getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen) return 1; } - if (code >= 0x110000) - return 0; - - if (self) { - const change_record *old = get_old_record(self, code); - if (old->category_changed == 0) { - /* unassigned */ - return 0; - } - } - - /* get offset into phrasebook */ offset = phrasebook_offset1[(code>>phrasebook_shift)]; offset = phrasebook_offset2[(offset<<phrasebook_shift) + |