原文链接:
http://www.fancyecommerce.com/2017/04/17/文件批量转换成utf-8/
1.安装
yum install -y enca
2.
在文件夹根目录下面创建文件:iconv_shell.sh,里面填写下面的内容:
#!/bin/bash
for file in `find ./ -name '*.php'`; do
echo "$file"
# iconv -f gb2312 -t utf8 -o $file $file
enca -L zh_CN -x UTF-8 $file
done
执行这个文件:
sh iconv_shell.sh