Tuesday 8 June 2010

Shell script to convert all files from 866 to cp1251 using iconv.

#! /bin/sh
for f in ../mac/*.mac
do 
 cp $f $f.old
 rm -f $f
 iconv -f 866 -t CP1251 $f.old>$f
done
rm -f ../mac/*.old
Find version:
find . -name '*.txt' -exec iconv --verbose -f windows-1252 -t utf-8 {} > {} \;