Fork me on GitHub

GBK转UTF8

shell 脚本自动GBK转UTF8

for i in `find . -name "*.java"`; do iconv -f gbk -t utf-8 $i > $i.new; done
# 如果出现 cannot convert,把对应错误转换的文件.new删掉
find . -name "*.new" | sed 's/\(.*\).new$/mv "&" "\1"/' | sh
## xml code
sed -i "" "s/gb2312/UTF-8/g" `grep gb2312 -rl .`
posted @ 2018-07-24 15:35 _落雨 阅读(...) 评论(...) 编辑 收藏