Skip to content

Instantly share code, notes, and snippets.

@ilkerde
Created May 19, 2014 19:44
Show Gist options
  • Save ilkerde/4a20350d1021e2b85217 to your computer and use it in GitHub Desktop.
Save ilkerde/4a20350d1021e2b85217 to your computer and use it in GitHub Desktop.
Convert Latin1 to UTF8 in CLI
find . -type f -iname *.html -exec file --mime-encoding {} \; | grep -Z iso-8859-1 | sed 's/: iso-8859-1//g' | xargs -i{} sh -c 'iconv -f iso-8859-1 -t utf-8 -o "{}".utf8 "{}";mv -f "{}".utf8 "{}";'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment