#!/bin/bash
convert_file()
{
for file in `find .`
do
if [[ -f $file ]]
then
if [[ ${file##*.} == lua || ${file##*.} == ini ]]; then
cp $file $file".bak"
iconv -f GB2312 -t UTF-8 $file > $file
echo $file
fi
fi
done
}
convert_file
转载于:https://www.cnblogs.com/praglody/p/9249741.html