From e2362d4d5185d02fa857bf381e7bd52e66fafc73 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 25 Jan 2025 14:25:22 -0500 Subject: [PATCH] searcher: add log message noting detected encoding This helps improve diagnostics. Otherwise it can be easy to miss that ripgrep is doing transcoding. Fixes #2979 --- crates/searcher/src/searcher/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/searcher/src/searcher/mod.rs b/crates/searcher/src/searcher/mod.rs index deda17e5..c7d3b1d1 100644 --- a/crates/searcher/src/searcher/mod.rs +++ b/crates/searcher/src/searcher/mod.rs @@ -1004,6 +1004,7 @@ fn slice_has_bom(slice: &[u8]) -> bool { None => return false, Some((enc, _)) => enc, }; + log::trace!("found byte-order mark (BOM) for encoding {enc:?}"); [encoding_rs::UTF_16LE, encoding_rs::UTF_16BE, encoding_rs::UTF_8] .contains(&enc) }