UTF-8 decoding bug
This commit is contained in:
@@ -1469,7 +1469,12 @@ The tool will execute immediately and you'll receive the result (success or erro
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if s.len() > 100 {
|
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::<String>();
|
||||||
|
format!("{}...", truncated)
|
||||||
} else {
|
} else {
|
||||||
s.clone()
|
s.clone()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user