Created
September 14, 2019 23:38
-
-
Save kurdin/db53291407a40bafe430a3b6d9b3df8a to your computer and use it in GitHub Desktop.
win1251 to utf-8
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 ./ -name "*.php" -o -name "*.htm" -o -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.txt" -type f | | |
while read file | |
do | |
if ! file -bi $file | grep -q 'utf-8' | |
then | |
echo " $file" | |
mv "$file" "$file".icv | |
iconv -f WINDOWS-1251 -t UTF-8 "$file".icv > "$file" | |
rm -f "$file".icv | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment