X

Bash script to mass convert files from UTF-8 to Windows-1251

[shell]$ nano converter.sh

#/bin/bash
LIST=`ls *.php`
for i in $LIST;
do iconv -f UTF8 -t WINDOWS-1251 $i -o $i."windows-1251";
mv $i."windows-1251" $i;
done

[shell]$ chmod +x converter.sh
[shell]$ ./converter.sh

This post was last modified on 17.11.2014 09:21

Artem: Аудит, Разработка, ИБ, Поддержка и SEO сайтов
Related Post