Skip to content

Commit

Permalink
Adjust CJK Ideograph range to Unicode 4.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
loewis committed Mar 11, 2006
1 parent 88ca467 commit c350912
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Modules/unicodedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}

Expand All @@ -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;
Expand Down Expand Up @@ -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) +
Expand Down

0 comments on commit c350912

Please sign in to comment.