下面代码用于 linux: #! /bin/bash for i in "$@" do iconv -f GB18030 -t UTF-8 "$i" > tmp 2>/dev/null if [ $? -eq 0 ];then mv tmp "$i" else echo "________$i 没有被转换______" rm tmp fi done