1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-03-17 20:28:03 +02: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 #2979
This commit is contained in:
Andrew Gallant 2025-01-25 14:25:22 -05:00
parent d6b59feff8
commit e2362d4d51
No known key found for this signature in database
GPG Key ID: B2E3A4923F8B0D44

View File

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