Shell應用:批量將文件編碼由gbk轉utf-8,實例代碼:
[plain]
- #!/bin/bash
-
- // batch_change_GB2312_to_UTF-8
-
- cd directory
- find ./ -type f -name "*.java" | while read line;do
- echo $line
- iconv -f GB2312 -t UTF-8 $line > ${line}.utf8
- mv $line ${line}.gb2312
- mv ${line}.utf8 $line
- done