From 3b797a5f3ce1d77fa7d0ed991b52553c1b3e8757 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 24 Apr 2024 00:09:05 +0200 Subject: Properly upper- and titlecase ‘i’ and ‘j’ in Lithuanian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/unicode/prop/uprop_get_tc.c | 4 +++- lib/unicode/prop/uprop_get_uc.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/unicode/prop') diff --git a/lib/unicode/prop/uprop_get_tc.c b/lib/unicode/prop/uprop_get_tc.c index 442db6e..83649e1 100644 --- a/lib/unicode/prop/uprop_get_tc.c +++ b/lib/unicode/prop/uprop_get_tc.c @@ -64,9 +64,11 @@ _MLIB_DEFINE_BSEARCH_KV(struct rview, lookup, M(ch)) struct rview uprop_get_tc(rune ch, struct tcctx ctx) { + constexpr rune COMB_DOT_ABOVE = 0x307; + if (ch == 'i' && ctx.az_or_tr) return M(U'İ'); - if (ch == 0x307 && ctx.lt && ctx.after_i) + if (ch == COMB_DOT_ABOVE && ctx.lt && ctx.after_soft_dotted) return M(); rune CH = uprop_get_stc(ch); diff --git a/lib/unicode/prop/uprop_get_uc.c b/lib/unicode/prop/uprop_get_uc.c index ecb0883..4563921 100644 --- a/lib/unicode/prop/uprop_get_uc.c +++ b/lib/unicode/prop/uprop_get_uc.c @@ -119,11 +119,13 @@ _MLIB_DEFINE_BSEARCH_KV(struct rview, lookup, M(ch)) struct rview uprop_get_uc(rune ch, struct ucctx ctx) { + constexpr rune COMB_DOT_ABOVE = 0x307; + if (ch == U'ß') return ctx.ẞ ? M(U'ẞ') : M('S', 'S'); if (ch == 'i' && ctx.az_or_tr) return M(U'İ'); - if (ch == 0x307 && ctx.lt && ctx.after_i) + if (ch == COMB_DOT_ABOVE && ctx.lt && ctx.after_soft_dotted) return M(); rune CH = uprop_get_suc(ch); -- cgit v1.2.3