1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-07-27 18:21:57 -07:00

searcher: add log message noting detected encoding

This helps improve diagnostics. Otherwise it can be easy to miss that
ripgrep is doing transcoding.

Fixes 
This commit is contained in:
Andrew Gallant
2025-01-25 14:25:22 -05:00
parent d6b59feff8
commit e2362d4d51

@@ -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)
}