-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BOMs are not stripped consistently in --json output #1638
Comments
alessandroasm
added a commit
to alessandroasm/ripgrep
that referenced
this issue
Oct 2, 2020
UTF-8 encoded files with BOM didn't sniff the BOM from results, regardless of config.bom_sniffing; ripgrep already implemented this option for UTF-16 files correctly. Fixes BurntSushi#1638
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of ripgrep are you using?
How did you install ripgrep?
What operating system are you using ripgrep on?
Describe your bug.
When using ripgrep's
--json
flag on a file encoded as "UTF 8 with BOM" the BOM is not accounted for (as opposed to other encodings, such as UTF 16).What are the steps to reproduce the behavior?
UTF8
UTF8 BOM
UTF16
What is the actual behavior?
Here is the JSON output for the above three code blocks.
UTF8
UTF8 BOM
UTF16
What is the expected behavior?
I personally expected that ripgrep would strip the UTF8 BOM from the JSON report since that's what it does for UTF16 encodings. However, I'm not sure if this should be the case or not, considering that a UTF8 BOM is an optional file header.
The text was updated successfully, but these errors were encountered: