aboutsummaryrefslogtreecommitdiff
path: root/lib/unicode/string
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-04-14 23:03:25 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-04-14 23:03:25 +0200
commitfa481efe8e777bae2c2cca3649176d1ac7da6413 (patch)
tree40a32e492594310b490ed1f301817b72f982d617 /lib/unicode/string
parent5984a3211cc8a214305b9acbff07b3f3b78cac09 (diff)
Reorganize some things
Diffstat (limited to 'lib/unicode/string')
-rw-r--r--lib/unicode/string/u8upper.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/unicode/string/u8upper.c b/lib/unicode/string/u8upper.c
index 5ce0e77..6b041f6 100644
--- a/lib/unicode/string/u8upper.c
+++ b/lib/unicode/string/u8upper.c
@@ -8,17 +8,14 @@ u8upper(char8_t *restrict dst, size_t dstn, const char8_t *src, size_t srcn,
{
struct ucctx ctx = {
.az_or_tr = flags & CF_LANG_AZ,
- .cap_eszett = flags & CF_ẞ,
+ .lt = flags & CF_LANG_LT,
+ .ẞ = flags & CF_ẞ,
};
rune ch;
size_t n = 0;
- bool prev_was_i = false;
while (u8next(&ch, &src, &srcn)) {
- if (ch == 0x307 && prev_was_i && (flags & CF_LANG_LT))
- ctx.lt_after_i = true;
-
struct rview rv = uprop_get_uc(ch, ctx);
for (size_t i = 0; i < rv.len; i++) {
if (n >= dstn) {
@@ -27,9 +24,7 @@ u8upper(char8_t *restrict dst, size_t dstn, const char8_t *src, size_t srcn,
} else
n += rtou8(dst + n, dstn - n, rv.p[i]);
}
-
- prev_was_i = ch == 'i';
- ctx.lt_after_i = false;
+ ctx.after_i = ch == 'i';
}
return n;