Created
June 22, 2023 21:07
-
-
Save Swiss-Mac-User/92a5f1812c09d5b9c5d32395edb6ea16 to your computer and use it in GitHub Desktop.
Find non UTF-8 encoded files on macOS: a shell command to recursively list all non UTF-8 encoded files within a directory (and its subdirectories)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /path/to/dir -maxdepth 2 -type f -exec sh -c 'iconv -f utf-8 -t utf-8 "{}" >/dev/null 2>&1 || echo "{}: Not UTF-8"' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment