From 037bff70212a773a254e17ac1af1b97584cbd051 Mon Sep 17 00:00:00 2001 From: Dhanji Prasanna Date: Sun, 12 Oct 2025 14:54:28 +1100 Subject: [PATCH] UTF-8 decoding bug --- crates/g3-core/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/g3-core/src/lib.rs b/crates/g3-core/src/lib.rs index 47365b2..00855b9 100644 --- a/crates/g3-core/src/lib.rs +++ b/crates/g3-core/src/lib.rs @@ -1469,7 +1469,12 @@ The tool will execute immediately and you'll receive the result (success or erro } } else { if s.len() > 100 { - format!("{}...", &s[..100]) + // Use char_indices to respect UTF-8 boundaries + let truncated = s.char_indices() + .take(100) + .map(|(_, c)| c) + .collect::(); + format!("{}...", truncated) } else { s.clone() }