tcsh/nls-iconv

26 lines
696 B
Bash

#!/bin/sh
iconv_files () {
FROM=$1
shift
for i in $*
do
iconv --from $FROM --to UTF-8 < $i > $i.tmp
mv $i.tmp $i
perl -pi -e 's/codeset *= *[^[:space:]]*/codeset=UTF-8/' $i
done
}
iconv_files ISO-8859-1 nls/C/set*
iconv_files ISO-8859-1 nls/et/set*
iconv_files ISO-8859-1 nls/finnish/set*
iconv_files ISO-8859-1 nls/french/set*
iconv_files ISO-8859-1 nls/german/set*
iconv_files ISO-8859-7 nls/greek/set*
iconv_files ISO-8859-1 nls/italian/set*
iconv_files EUC-JP nls/ja/set*
iconv_files ISO-8859-2 nls/pl/set*
iconv_files KOI8-R nls/russian/set*
iconv_files ISO-8859-1 nls/spanish/set*
iconv_files KOI8-U nls/ukrainian/set*