Powershell does not recognize special characters such as: "ą", "ę", "ć" etc. when using something like that:
PS C:\> Get-Content test.txt | findstr /c:something
??? something
PS C:\> Get-Content test.txt | findstr /c:ę => nil
As you mayguess any special character will show question mark.
I use to run ruby scripts and while every character from script is working as intended when i run $stdin.gets.chomp
the input with special character is showing as empty box.
input = $stdin.gets.chomp
puts input => ▯
And it shows empty square box (with earlier version of Powershell it used question marks instead)
I was trying https://blogs.msdn.microsoft.com/powershell/2006/12/11/outputencoding-to-the-rescue/ but that does not work for me.
For any helpful advice i will be thankful.
Edit: Changing chcp to 1250 than $OutputEncoding =[Console]::OutputEncoding shows "ąęą something" when findstr /c:something but doesn't show anything when findstr /c:ę. Changing chcp creates compability issues when in ruby.
Edit2: Rest of my researches goes there Ruby compatibility error encoding
Thanks
Try using pure powershell, not mixing with executables (-match instead of findstr):
Finds occurences in the file (when txt is saved as Unicode):
My file contained 4 lines, as shown above