Skip to content
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

Failed to search files encoded with utf-16 #202

Open
ocitrev opened this issue Apr 30, 2019 · 1 comment
Open

Failed to search files encoded with utf-16 #202

ocitrev opened this issue Apr 30, 2019 · 1 comment

Comments

@ocitrev
Copy link

ocitrev commented Apr 30, 2019

UTF-16 LE with BOM encoding is used on Windows, especially for resources files in Visual Studio projects.

I created 4 files with the same text content, test pt\r\n, using different encodings:
test-utf16be-bom.txt
test-utf16le-bom.txt
test-utf8.txt
test-utf8-bom.txt

Only UTF-8 files display a result.

$ pt test .
.\test-utf8-bom.txt
1:test pt

.\test-utf8.txt
1:test pt

I would like for pt to search utf-16 encoded files

As a work-around, I use PowerShell's Select-String command to search within those files, but it is much slower than pt.

$ Select-String test -Path .\*
test-utf16be-bom.txt:1:test pt
test-utf16le-bom.txt:1:test pt
test-utf8-bom.txt:1:test pt
test-utf8.txt:1:test pt
@ocitrev
Copy link
Author

ocitrev commented Jul 3, 2019

I've created the PR #204 to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant