Windows 7 findstr to find a string with a letter with accent mark in console

  • Thread starter Thread starter yong321
  • Start date Start date
Y

yong321

Guest
My text file contains two words each on one line. Both words have letter é. I saved the file in UTF-8 encoding in Notepad, and set console font to Lucida Console and code page to 65001 (Unicode).

D:\temp>chcp 65001
Active code page: 65001

D:\temp>type myfile.txt
caché
fiancée

Now I want to search for the word with findstr.

D:\temp>findstr "caché" myfile.txt

D:\temp>findstr "fiancée" myfile.txt

D:\temp>findstr "cach" myfile.txt
caché
FINDSTR: Write error

D:\temp>findstr "fianc" myfile.txt
fiancéeFINDSTR: Write error

D:\temp>findstr "c" myfile.txt <-- this search should return both lines
caché
FINDSTR: Write error

How can I fully specify the word (including é) as a search string? How do I avoid the "Write error" when the output contains é? I don't mind using other commands or Powershell, as long as it's in a console. The text doesn't have to be Unicode (for example, there won't be Euro sign). It's just Latin text, with a few letters that may have accent marks.

More...
 
Back
Top