From 32dbf6a2244eb2c269585f6c2f752c753db48dc8 Mon Sep 17 00:00:00 2001 From: Harrison Booth <73434116+Harrison-Booth@users.noreply.github.com> Date: Fri, 30 Oct 2026 19:37:03 -0500 Subject: [PATCH] G705: fix single-character case conversions --- crates/functions/src/text.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/functions/src/text.rs b/crates/functions/src/text.rs index a7b82b10a..d056b6ef9 100644 --- a/crates/functions/src/text.rs +++ b/crates/functions/src/text.rs @@ -126,12 +126,16 @@ fn upper_char(ch: char) -> char { } } +fn proper_upper_char(ch: char) -> char { + if ch == '\u{130}' { 'I' } else { upper_char(ch) } +} + fn lower(a: &[Arg], _c: &mut dyn Ctx) -> R { - text_val(text(a, 0)?.chars().map(lower_char).collect()) + text_val(text(a, 0)?.chars().map(lower_char).collect::()) } fn upper(a: &[Arg], _c: &mut dyn Ctx) -> R { - text_val(text(a, 0)?.chars().map(upper_char).collect()) + text_val(text(a, 0)?.chars().map(upper_char).collect::()) } fn proper(a: &[Arg], _c: &mut dyn Ctx) -> R { @@ -143,7 +147,7 @@ fn proper(a: &[Arg], _c: &mut dyn Ctx) -> R { if prev_letter { out.push(lower_char(ch)); } else { - out.push(upper_char(ch)); + out.push(proper_upper_char(ch)); } prev_letter = true; } else {