Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9d157a

Browse files
author
Victor Stinner
committed
Merged revisions 78647 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ................ r78647 | victor.stinner | 2010-03-04 13:14:57 +0100 (jeu., 04 mars 2010) | 12 lines Merged revisions 78646 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r78646 | victor.stinner | 2010-03-04 13:09:33 +0100 (jeu., 04 mars 2010) | 5 lines Issue #1054943: Fix unicodedata.normalize('NFC', text) for the Public Review Issue #29. PR #29 was released in february 2004! ........ ................
1 parent da13545 commit a9d157a

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

Lib/test/test_unicodedata.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ def test_normalize(self):
186186
# The rest can be found in test_normalization.py
187187
# which requires an external file.
188188

189+
def test_pr29(self):
190+
# http://www.unicode.org/review/pr-29.html
191+
for text in (u"\u0b47\u0300\u0b3e", u"\u1100\u0300\u1161"):
192+
self.assertEqual(self.db.normalize('NFC', text), text)
193+
189194
def test_east_asian_width(self):
190195
eaw = self.db.east_asian_width
191196
self.assertRaises(TypeError, eaw, b'a')

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ Core and Builtins
100100
Library
101101
-------
102102

103+
- Issue #1054943: Fix unicodedata.normalize('NFC', text) for the Public Review
104+
Issue #29
105+
103106
- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
104107
reset also the pointer to the current pointer context.
105108

Modules/unicodedata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ nfc_nfkc(PyObject *self, PyObject *input, int k)
684684
comb = 0;
685685
while (i1 < end) {
686686
int comb1 = _getrecord_ex(*i1)->combining;
687-
if (comb1 && comb == comb1) {
687+
if (comb && (comb1 == 0 || comb == comb1)) {
688688
/* Character is blocked. */
689689
i1++;
690690
continue;

0 commit comments

Comments
 (0)