Re: Combining Characters
Alex Shpilkin via Unicode <[email protected]> Fri, 19 Dec 2025 23:17:25 +0200
| Newsgroups | gmane.text.unicode.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Dec 19 2025 at 23:02:55 +02:00:00, Alex Shpilkin <[email protected]> wrote: > I havenāt gotten to implementing canonical composition yet And you can tell because the algorithm Iāve posted is wrong. Attempted correction (which does introduce a bit of special handling to account for the starter+starter case): starter = 0 # sentinel not part of any compositions starter index = uninitialized index = 0 while index < length of string: composition = try to compose (starter, string[index]) if succeeded and (ccc[string[index]] != 0 or index == starter index + 1): string[starter index] = composition delete string[index] else: if ccc[string[index]] == 0: # NB only this late starter = string[index] starter index = index index = index + 1 -- Sorry for the noise, Alex