-
-
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
document Windows locale and path separator settings #1667
Comments
I don't think this is a bug with ripgrep. It's almost certainly some kind of misconfiguration of your locale settings in Git Bash. You might try running the
It's Windows and Windows uses backslashes. So that's what ripgrep uses. AIUI, things like |
Thanks for your hint with the path separator from #275. For the other problem with garbled umlauts I found a solution at https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8/1435645#1435645. As probably many other users of ripgrep with a UNIX-like environment like CygWin or MingW64 Git Bash are affected, these solutions should be mentioned in FAQ.md (for umlaut problem) or even in README.md (for alias). Suggested text: Define an alias for rg which generates (forward) slashes instead of backslashes: If your files contain UTF-8 encoded umlauts or other non-ASCII characters (and rg in Bash does not display them nicely), you can enable a beta feature of Windows 10. This fixes issue #1667 but might cause unwanted side effects for other software. English system: German system: |
Aye, better docs here would be great. Thanks for the idea and the text! |
If someone wants to open a PR to improve the FAQ for ripgrep here that would be great. Otherwise I don't quite feel qualified to write this myself. |
What version of ripgrep are you using?
ripgrep 12.1.1 (rev 7cb2113)
-SIMD -AVX (compiled)
+SIMD -AVX (runtime)
How did you install ripgrep?
Unzipped Windows 64 bit versions (both MSVC and GNU behave identical, using MSVC).
What operating system are you using ripgrep on?
Windows 10 Pro
Build 18362.19h1_release.190318-1202
Describe your bug.
Inconsistent output of umlauts on Windows depending on running ripgrep from CMD or Git Bash.
What are the steps to reproduce the behavior?
Both shells are configured to use Lucida Console font.
Using standard CMD (PowerShell not tested):
cd ripgrep-test
type subdir\ExampleWithUmlauts.cs
rg SubjectCodes
Using Git Bash (MINGW64):
cd ripgrep-test
cat subdir/ExampleWithUmlauts.cs
rg SubjectCodes
What is the actual behavior?
CMD:
Git Bash:
What is the expected behavior?
While it is nice that it produces readable umlauts when run from CMD, the behaviour when run via Git Bash is not that helpful. It should output readable umlauts and it should print paths with UNIX-like slashes instead of problematic backslashes, including support for drives like "/c/path" for "C:\path".
I did not test with paths containing spaces or umlauts, which - at least for spaces - might have to be treated differently depending on the environment ...
ripgrep-test.zip
See also #234 and #530 - even if those refer to file name globbing differences.
The text was updated successfully, but these errors were encountered: