Skip to content

Commit e2362d4

Browse files
committed
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
1 parent d6b59fe commit e2362d4

File tree

1 file changed

+1
-0
lines changed
  • crates/searcher/src/searcher

1 file changed

+1
-0
lines changed

crates/searcher/src/searcher/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ fn slice_has_bom(slice: &[u8]) -> bool {
10041004
None => return false,
10051005
Some((enc, _)) => enc,
10061006
};
1007+
log::trace!("found byte-order mark (BOM) for encoding {enc:?}");
10071008
[encoding_rs::UTF_16LE, encoding_rs::UTF_16BE, encoding_rs::UTF_8]
10081009
.contains(&enc)
10091010
}

0 commit comments

Comments
 (0)