iconv -c -f utf-8 -t euc-kr source.txt > converted.txt
#!/bin/bash
ENCODING=`file -b --mime-encoding $1`
echo encoding: $ENCODING
case $ENCODING in
iso-8859-1 | euc-kr ) echo "converting euc-kr to utf" && iconv -c -f euc-kr -t utf-8 $1 > $1-temp-utf && mv $1 $1-original-euckr && mv $1-temp-utf $1;;
utf-8 ) echo "already utf-8. skipped.";;
*) echo "unknown encding: $ENCODING";;
esac