summaryrefslogtreecommitdiff
path: root/Modules/unicodedata.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-09-14 23:53:47 -0700
committerBenjamin Peterson <benjamin@python.org>2016-09-14 23:53:47 -0700
commitd734fb01a2767352005604619186787d4fad1810 (patch)
treecbdb84adf3ad2ae7fb279f6c82d67685988d1962 /Modules/unicodedata.c
parent1a489e2c5b307305f8cb11a7a1e8a729384dbb6c (diff)
downloadcpython-d734fb01a2767352005604619186787d4fad1810.tar.gz
Unicode 9.0.0
Not completely mechanical since support for East Asian Width changes?emoji codepoints became Wide?had to be added to unicodedata.
Diffstat (limited to 'Modules/unicodedata.c')
-rw-r--r--Modules/unicodedata.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index b07d9410e5..c86fe23b9d 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -45,6 +45,7 @@ typedef struct change_record {
const unsigned char category_changed;
const unsigned char decimal_changed;
const unsigned char mirrored_changed;
+ const unsigned char east_asian_width_changed;
const double numeric_changed;
} change_record;
@@ -375,6 +376,8 @@ unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr)
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0)
index = 0; /* unassigned */
+ else if (old->east_asian_width_changed != 0xFF)
+ index = old->east_asian_width_changed;
}
return PyUnicode_FromString(_PyUnicode_EastAsianWidthNames[index]);
}