Skip to content

Commit b98618f

Browse files
Serhiy's review
1 parent 8c6b8f0 commit b98618f

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

Lib/test/test_unicodedata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def test_decomposition(self):
380380

381381
# Hangul characters
382382
self.assertEqual(self.db.decomposition('\uAC00'), '1100 1161')
383-
self.assertEqual(self.db.decomposition('\uAC01'), '1100 1161 11A8')
383+
self.assertEqual(self.db.decomposition('\uD4DB'), '1111 1171 11B6')
384384
self.assertEqual(self.db.decomposition('\uC2F8'), '110A 1161')
385385
self.assertEqual(self.db.decomposition('\uD7A3'), '1112 1175 11C2')
386386

Modules/unicodedata.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
472472
}
473473

474474
// Hangul Decomposition.
475-
// See https://www.unicode.org/versions/latest/core-spec/chapter-3/#G56669
475+
// See section 3.12.2, "Hangul Syllable Decomposition"
476+
// https://www.unicode.org/versions/latest/core-spec/chapter-3/#G56669
476477
if (SBase <= code && code < (SBase + SCount)) {
477478
int SIndex = code - SBase;
478479
int L = LBase + SIndex / NCount;
@@ -481,7 +482,8 @@ unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
481482
if (T != TBase) {
482483
PyOS_snprintf(decomp, sizeof(decomp),
483484
"%04X %04X %04X", L, V, T);
484-
} else {
485+
}
486+
else {
485487
PyOS_snprintf(decomp, sizeof(decomp),
486488
"%04X %04X", L, V);
487489
}
@@ -604,7 +606,8 @@ nfd_nfkd(PyObject *self, PyObject *input, int k)
604606
output = new_output;
605607
}
606608
// Hangul Decomposition.
607-
// See https://www.unicode.org/versions/latest/core-spec/chapter-3/#G56669
609+
// See section 3.12.2, "Hangul Syllable Decomposition"
610+
// https://www.unicode.org/versions/latest/core-spec/chapter-3/#G56669
608611
if (SBase <= code && code < (SBase+SCount)) {
609612
int SIndex = code - SBase;
610613
int L = LBase + SIndex / NCount;

0 commit comments

Comments
 (0)