2 ms·
> If they are supposed to act locale-specific, then this "trick" simply leads to wrong results and should be avoided. These tools are definitely supposed to ac
by zajio1am 4y ago
> If they are supposed to act locale-specific, then this "trick" simply leads to wrong results and should be avoided.
These tools are definitely supposed to act locale-specific (e.g. '.' regular expression should match one unicode codepoint even if it is multibyte), but in many cases one uses it on ASCII-only data (e.g. logs from system daemons that runs with LC=C anyways), so using this 'trick' is fine.
Mainly, i use this trick not for speedup, but because grep (with UTF-8 locale) has issues with invalid UTF-8 sequences in data, while grep with C locale accepts them.