Skip to content

Commit 0010944

Browse files
committed
Fix null character count for Latin 1 string decoding
1 parent 093cfea commit 0010944

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/files.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub(crate) fn guess_content(
254254
// ISO-8859-1 aka Latin 1), treat them as such.
255255
let (latin1_str, _encoding, saw_malformed) = encoding_rs::WINDOWS_1252.decode(bytes);
256256
if !saw_malformed {
257-
let num_null = utf16_string
257+
let num_null = latin1_str
258258
.chars()
259259
.take(5000)
260260
.filter(|c| *c == std::char::REPLACEMENT_CHARACTER || *c == '\0')

0 commit comments

Comments
 (0)