Skip to content

Instantly share code, notes, and snippets.

@rmetzler
Created June 18, 2012 10:43
Show Gist options
  • Save rmetzler/2947828 to your computer and use it in GitHub Desktop.
Save rmetzler/2947828 to your computer and use it in GitHub Desktop.
find all non UTF-8 encoded files
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail
@anasram
Copy link

anasram commented Apr 12, 2020

Using file command, I think you can find a way to do it in a simpler way, yet I don't know how.

Try this to understand what I mean:

file --mime-encoding *

@vtuz
Copy link

vtuz commented Jan 28, 2021

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment