Skip to content

Commit

Permalink
searcher: add log message noting detected encoding
Browse files Browse the repository at this point in the history
This helps improve diagnostics. Otherwise it can be easy to miss that
ripgrep is doing transcoding.

Fixes #2979
  • Loading branch information
BurntSushi committed Jan 25, 2025
1 parent d6b59fe commit e2362d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/searcher/src/searcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit e2362d4

Please sign in to comment.