1、如何查看一个文件使用哪种字符集:
vim filename
:set encoding
结果:fileencoding=utf-8
2、字符集转换:
for filename in `ls -1 *.*`
do
cd 路径
iconv -f UTF-8 -t GB18030 ${filename} > ${filename}.tmp
mv ${filename}.tmp ${filename}
done
主要代码:
iconv -f UTF-8 -t GB18030
本文出自 “守候者” 博客,请务必保留此出处http://shouhouzhe.blog.51cto.com/2351955/1686850
原文地址:http://shouhouzhe.blog.51cto.com/2351955/1686850