When I want to recursively search TeX files for characters unsupported by my font, I typically start with a search for non-breakable spaces and zero-width spaces. These are difficult to produce on the terminal command line, therefore I use their UTF-8 hexidecimal representations.
env LANG=C grep -obUaP "\xc2\xa0" $(find -name '*.tex') env LANG=C grep -obUaP "\xe2\x80\x8b" $(find -name '*.tex')
Why do I need to explicitly set the
LANG environment variable to
C as shown above:
-a simultaneously may seem erroneous, but this version of the manual states that
When type is ‘binary’, grep may treat non-text bytes as line terminators even without the -z (--null-data) option.
-a forces only line terminators to be line terminators (not so clear).