]> granicus.if.org Git - python/commitdiff
Adjust CJK Ideograph range to Unicode 4.1.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 11 Mar 2006 12:16:23 +0000 (12:16 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 11 Mar 2006 12:16:23 +0000 (12:16 +0000)
Modules/unicodedata.c

index 5a4378babf1db331f137760c058e488804c62bdf..9eda6537b6a6cbc78cee6a0f0dbaf103d293c3e5 100644 (file)
@@ -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) +