| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a2bfe60 commit c8cdbf7
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,11 +16,11 @@ | |||
| 16 | 16 | ||
| 17 | 17 | This module provides access to the Unicode Character Database which defines | |
| 18 | 18 | character properties for all Unicode characters. The data in this database is | |
| 19 | - based on the :file:`UnicodeData.txt` file version 4.1.0 which is publicly | ||
| 19 | + based on the :file:`UnicodeData.txt` file version 5.1.0 which is publicly | ||
| 20 | 20 | available from ftp://ftp.unicode.org/. | |
| 21 | 21 | ||
| 22 | 22 | The module uses the same names and symbols as defined by the UnicodeData File | |
| 23 | - Format 4.1.0 (see http://www.unicode.org/Public/4.1.0/ucd/UCD.html). It defines | ||
| 23 | + Format 5.1.0 (see http://www.unicode.org/Public/5.1.0/ucd/UCD.html). It defines | ||
| 24 | 24 | the following functions: | |
| 25 | 25 | ||
| 26 | 26 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | class UnicodeMethodsTest(unittest.TestCase): | |
| 17 | 17 | ||
| 18 | 18 | # update this, if the database changes | |
| 19 | - expectedchecksum = 'c198ed264497f108434b3f576d4107237221cc8a' | ||
| 19 | + expectedchecksum = 'aef99984a58c8e1e5363a3175f2ff9608599a93e' | ||
| 20 | 20 | ||
| 21 | 21 | def test_method_checksum(self): | |
| 22 | 22 | h = hashlib.sha1() | |
@@ -75,7 +75,7 @@ def tearDown(self): | |||
| 75 | 75 | class UnicodeFunctionsTest(UnicodeDatabaseTest): | |
| 76 | 76 | ||
| 77 | 77 | # update this, if the database changes | |
| 78 | - expectedchecksum = '4e389f97e9f88b8b7ab743121fd643089116f9f2' | ||
| 78 | + expectedchecksum = '3136d5afd787dc2bcb1bdcac95e385349fbebbca' | ||
| 79 | 79 | ||
| 80 | 80 | def test_function_checksum(self): | |
| 81 | 81 | data = [] | |
@@ -225,6 +225,16 @@ def test_digit_numeric_consistent(self): | |||
| 225 | 225 | def test_bug_1704793(self): | |
| 226 | 226 | self.assertEquals(self.db.lookup("GOTHIC LETTER FAIHU"), u'\U00010346') | |
| 227 | 227 | ||
| 228 | + def test_ucd_510(self): | ||
| 229 | + import unicodedata | ||
| 230 | + # In UCD 5.1.0, a mirrored property changed wrt. UCD 3.2.0 | ||
| 231 | + self.assert_(unicodedata.mirrored(u"\u0f3a")) | ||
| 232 | + self.assert_(not unicodedata.ucd_3_2_0.mirrored(u"\u0f3a")) | ||
| 233 | + # Also, we now have two ways of representing | ||
| 234 | + # the upper-case mapping: as delta, or as absolute value | ||
| 235 | + self.assert_(u"a".upper()==u'A') | ||
| 236 | + self.assert_(u"\u1d79".upper()==u'\ua77d') | ||
| 237 | + | ||
| 228 | 238 | def test_main(): | |
| 229 | 239 | test.test_support.run_unittest( | |
| 230 | 240 | UnicodeMiscTest, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,6 +68,8 @@ C-API | |||
| 68 | 68 | Library | |
| 69 | 69 | ------- | |
| 70 | 70 | ||
| 71 | + - Issue #3811: The Unicode database was updated to 5.1. | ||
| 72 | + | ||
| 71 | 73 | - Issue #3809: Fixed spurious 'test.blah' file left behind by test_logging. | |
| 72 | 74 | ||
| 73 | 75 | - Issue 3781: Clean up the API for warnings.catch_warnings() by having it | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,8 @@ | |||
| 1 | 1 | /* ------------------------------------------------------------------------ | |
| 2 | 2 | ||
| 3 | - unicodedata -- Provides access to the Unicode 4.1 data base. | ||
| 3 | + unicodedata -- Provides access to the Unicode 5.1 data base. | ||
| 4 | 4 | ||
| 5 | - Data was extracted from the Unicode 4.1 UnicodeData.txt file. | ||
| 5 | + Data was extracted from the Unicode 5.1 UnicodeData.txt file. | ||
| 6 | 6 | ||
| 7 | 7 | Written by Marc-Andre Lemburg (mal@lemburg.com). | |
| 8 | 8 | Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) | |
@@ -34,6 +34,7 @@ typedef struct change_record { | |||
| 34 | 34 | const unsigned char bidir_changed; | |
| 35 | 35 | const unsigned char category_changed; | |
| 36 | 36 | const unsigned char decimal_changed; | |
| 37 | + const unsigned char mirrored_changed; | ||
| 37 | 38 | const int numeric_changed; | |
| 38 | 39 | } change_record; | |
| 39 | 40 | ||
@@ -354,6 +355,8 @@ unicodedata_mirrored(PyObject *self, PyObject *args) | |||
| 354 | 355 | const change_record *old = get_old_record(self, c); | |
| 355 | 356 | if (old->category_changed == 0) | |
| 356 | 357 | index = 0; /* unassigned */ | |
| 358 | + else if (old->mirrored_changed != 0xFF) | ||
| 359 | + index = old->mirrored_changed; | ||
| 357 | 360 | } | |
| 358 | 361 | return PyInt_FromLong(index); | |
| 359 | 362 | } | |
@@ -1177,11 +1180,11 @@ PyDoc_STRVAR(unicodedata_docstring, | |||
| 1177 | 1180 | "This module provides access to the Unicode Character Database which\n\ | |
| 1178 | 1181 | defines character properties for all Unicode characters. The data in\n\ | |
| 1179 | 1182 | this database is based on the UnicodeData.txt file version\n\ | |
| 1180 | - 4.1.0 which is publically available from ftp://ftp.unicode.org/.\n\ | ||
| 1183 | + 5.1.0 which is publically available from ftp://ftp.unicode.org/.\n\ | ||
| 1181 | 1184 | \n\ | |
| 1182 | 1185 | The module uses the same names and symbols as defined by the\n\ | |
| 1183 | - UnicodeData File Format 4.1.0 (see\n\ | ||
| 1184 | - http://www.unicode.org/Public/4.1.0/ucd/UCD.html)."); | ||
| 1186 | + UnicodeData File Format 5.1.0 (see\n\ | ||
| 1187 | + http://www.unicode.org/Public/5.1.0/ucd/UCD.html)."); | ||
| 1185 | 1188 | ||
| 1186 | 1189 | PyMODINIT_FUNC | |
| 1187 | 1190 | initunicodedata(void) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments