-
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
Ripgrep outputs BOM character for match on first line of a file with a BOM #632
Comments
@roblourens That is interesting. I think my intuition was the opposite, but I could be completely wrong? For example, if you run |
But shouldn't the output encoding depend on the locale? |
@FSMaxB ripgrep doesn't respect any locale settings and always uses UTF-8 for output. That seems orthogonal to the issue reported here. |
Ok, sorry for the noise. |
It seems to me like the BOM is metadata and not really part of the actual text of the file. But I'm not sure and haven't checked what other tools do. |
I can see why someone might expect it to be stripped out tho |
I don't quite know what the right answer is here. Given that both BSD and GNU grep leave the BOM in tact, I'm also inclined to take that path as well. In particular, in the absence of more concrete use cases where removing the BOM makes sense, I'd like to side with tradition on this one. I'm going to close this for now, but if there is a more compelling argument to be made, please make it here and we can revisit this. |
From microsoft/vscode#35633
As the title says, I noticed that ripgrep will output the BOM character when printing a match in the first line. Not really blocking anything, but I think it would make sense for ripgrep to strip this.
The text was updated successfully, but these errors were encountered: