findstr or grep that autodetects chararacter encoding (UTF-16)

后端 未结 7 1171
遥遥无期
遥遥无期 2021-01-04 08:34

I want to do this:

 findstr /s /c:some-symbol *

or the grep equivalent

 grep -R some-symbol *

but I need

7条回答
  •  花落未央
    2021-01-04 09:25

    In higher versions of Windows, UTF-16 is supported out-of-box. If not, try changing active code page by chcp command.

    In my case when using findstr alone was failing for UTF-16 files, however it worked with type:

    type *.* | findstr /s /c:some-symbol
    

提交回复
热议问题