the_silver_searcher
the_silver_searcher copied to clipboard
Add --as-text option
This PR adds a new --as-text
option, which is equivalent to the --text
option in GNU Grep.
Without this option, ag
sometimes interprets cp1251-encoded sources as binaries. Effectively, the new option disables the binary detection heuristic, which makes perfect sense for situations where ag
is asked to perform search only in files with a specific extension (corresponding to a particular language).
Ping. I use this feature all the time to reliably grep through sources that contain non-ASCII characters.
Hi, really required this param, to proper search
Any follow up on this?
Seconding this. I was surprised to find I couldn't just rename my binary file to .txt
and ag through it :)
@murmour Thank you for MR, you saved me.
Also voting for inclusion this patch into main source tree. For some reason it treats regular text files in single byte encoding as binary ones.