Last active
October 27, 2016 09:51
-
-
Save FernandoBasso/d71d334797fc9ca7fe95a432a74d6cd8 to your computer and use it in GitHub Desktop.
On the command line, uses `find` and `iconv` to convert certain files from ISO-8859-1 to UTF-8 (make sure the original files are indeed in ISO-8859-1).
This file contains hidden or 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
#!/usr/bin/bash | |
find ./ -name '*.php' -o -name '*.html' -o -name '*.css' -o -name '*.js' -type f | | |
while read file | |
do | |
echo " $file" | |
mv $file $file.icv | |
iconv -f ISO-8859-1 -t UTF-8 $file.icv > $file | |
rm -f $file.icv | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment