-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Many file skipped for unknown reasons #318
Comments
Can you run Also, what version of ripgrep are you running? See |
Sure:
This is the latest release (I think) - I also tested with something I built after from my PR which I think is newer than this release, but saw the same results. |
Interestingly, Is there anyway you can reproduce this on a public repo of code so I can try? |
Try exactly what I posted in my first message - you should see similar results on most Windows machines - I used the latest supported Windows 10 release, but I would expect similar results in earlier versions of Windows. |
Hmm, your directory has a lot more stuff in it than my Windows 7 VM. Let me boot up my Windows 10 laptop. |
Did you compile ripgrep from source? Or did you download a release? |
I think I've figured out the problem here. If you do this: If so, then I think the problem here is that some of the files you're searching contain invalid UTF-8, and Rust's standard library by default returns an error if you try to write invalid UTF-8 to the console. (The reason why is because UTF-8 needs to be transcoded to UTF-16 to write to the console.) I think the right answer here is to lossily decode the UTF-8 before sending it to This UTF-8 check doesn't happen if you write to a file, which is why redirecting to stdout should produce the expected output. The reason why no error is printed is because ripgrep isn't checking an error when writing to stdout, which is bug #200. |
In PowerShell, if I do |
Currently, Rust's standard library will yield an error if one tries to write invalid UTF-8 to a Windows console. This is problematic for ripgrep when it tries to print matched lines that contain invalid UTF-8. We work around this by modifying the `termcolor` library to lossily decode UTF-8 before sending it to `std::io::Stdout`. This may result in some Unicode replacement chars being shown in the output, but this is strictly better than erroring or not showing anything at all. Fixes #318.
Currently, Rust's standard library will yield an error if one tries to write invalid UTF-8 to a Windows console. This is problematic for ripgrep when it tries to print matched lines that contain invalid UTF-8. We work around this by modifying the `termcolor` library to lossily decode UTF-8 before sending it to `std::io::Stdout`. This may result in some Unicode replacement chars being shown in the output, but this is strictly better than erroring or not showing anything at all. Fixes #318.
Much better now, thanks. |
On Windows 10, I'm seeing fewer results than expected, plus fewer matches when ignoring case.
Notice 2 matches from the case sensitive search, 1 from the case-insensitive search, and many matches using findstr (with many omitted.)
The text was updated successfully, but these errors were encountered: