Fix null character count for Latin 1 string decoding

pull/864/head
Wilfred Hughes 2025-07-10 09:24:07 +07:00
parent 093cfea931
commit 0010944ef5
1 changed files with 1 additions and 1 deletions

@ -254,7 +254,7 @@ pub(crate) fn guess_content(
// ISO-8859-1 aka Latin 1), treat them as such.
let (latin1_str, _encoding, saw_malformed) = encoding_rs::WINDOWS_1252.decode(bytes);
if !saw_malformed {
let num_null = utf16_string
let num_null = latin1_str
.chars()
.take(5000)
.filter(|c| *c == std::char::REPLACEMENT_CHARACTER || *c == '\0')