I use grep to search for patterns which is working properly. However, when I redirect the output to any file, the output gets corrupted due to the encoding.
Is there a way to make the bash in windows output the file in normal UTF-8 encoding so normal text editors can read it properly?
EDIT: It looks like this when I redirect output the grep results to any file:
[35m[KFile.txt[m[K[36m[K:[m[K[01;31m
I'm running latest Windows and I have bash installed by using developer mode and enabling the bash.
The output gets messed up in the process. Even Windows version of linux text editors display the weird output. However, if I run cat on the file containing the weird output. It shows the output just fine with no issues.
I'm using Notepad++ to view the results.
Thanks
grep
output is redirected (and aren't for me). You can force their suppression by precedinggrep
withenv LS_COLORS=
.--color=never
to thegrep
run string. Somehow I missed it in theman
page on Windows WSL, though it's there, and I've used it elsewhere.