miscellaneous_tips:20_software_development:detect_non-ascii_characters_in_text_files

Detect Non-ASCII Characters In Text Files

The grep utility can be used to detect non-ASCII characters in text files, e.g. in programming code:

LANG= grep –color='auto' -P -n '[^\x00-\x7F]' *.c *.h


:!: Please note the LANG= term used above overrides the localization / language configured for the console. There have been cases where the grep command didn't work as expected if a specific localization was configured.


Martin Burnicki martin.burnicki@burnicki.net 2019-04-26

  • miscellaneous_tips/20_software_development/detect_non-ascii_characters_in_text_files.txt
  • Zuletzt geändert: 2021-01-18 17:20
  • (Externe Bearbeitung)