Skip to content

Instantly share code, notes, and snippets.

@jonaswebdev
Created May 31, 2018 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonaswebdev/bcd8784d1aabe4136807bdb03623051f to your computer and use it in GitHub Desktop.
Save jonaswebdev/bcd8784d1aabe4136807bdb03623051f to your computer and use it in GitHub Desktop.
Script Convert/Update File encoding to UTF-8 in mass/batch (Eg: WINDOWS-1252 to UTF-8)
#!/bin/sh
for file in $(find . -name "*.php" -type f)
do
iconv -f WINDOWS-1252 -t UTF-8 "$file" > "$file".utf8 && mv "$file".utf8 "$file" && echo "Success: $file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment