From 37d7ba5193a8de6bd31a38a7d93a37b66db1dd9d Mon Sep 17 00:00:00 2001 From: Diego Frias Date: Mon, 1 Jun 2026 11:32:41 -0700 Subject: [PATCH] Fix recognizing 0x11A7 as a Hangul T syllable in Unicode normalization 0x11A7 is not a valid Hangul T syllable despite being equal to T_BASE. This is because, per the Unicode spec: TBase is set to one less than the beginning of the range of trailing consonants, which starts at U+11A8. TCount is set to one more than the number of trailing consonants relevant to the decomposition algorithm: (11C216 - 11A816 + 1) + 1. So the first valid Hangul T syllable is 0x11A8. Also see https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G59434 for where the spec describes the usage of 0x11A8, not 0x11A7, during composition. --- src/common/unicode_norm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/unicode_norm.c b/src/common/unicode_norm.c index cf84f202414..0534ae34640 100644 --- a/src/common/unicode_norm.c +++ b/src/common/unicode_norm.c @@ -236,7 +236,7 @@ recompose_code(uint32 start, uint32 code, uint32 *result) /* Check if two current characters are LV and T */ else if (start >= SBASE && start < (SBASE + SCOUNT) && ((start - SBASE) % TCOUNT) == 0 && - code >= TBASE && code < (TBASE + TCOUNT)) + code > TBASE && code < (TBASE + TCOUNT)) { /* make syllable of form LVT */ uint32 tindex = code - TBASE; -- 2.39.5 (Apple Git-154)