将当前目录下的所有hpp文件转换为utf8编码
#!/bin/bash
tmp_file="/tmp/a"
for file in `find . -type f -name "*.hpp"`; do
enc=`file -i $file | cut -d"=" -f2`
iconv -f $enc -t "UTF-8" $file -o $tmp_file
mv $tmp_file $file
echo "convert " $file "from " $enc "to utf-8"
done
exit 0
网友评论