将其他编码文件转化为UTF8文件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yaoshenjie/article/details/76412548
#!/bin/bash
# @file             utf-8.sh
# @author       sjyao
# @brief          修改当前目录下的.cpp .c .h文件的编码格式为utf-8
# @date          2014-07-23
# @History
# 1、2014-07-23  author sjyao  
for i in $(ls *.cpp *.c *.h *.xpp)
do
echo "begin to modify the fileencoding of $i to utf-8"
vi +":set fileencoding=utf-8" +":set fileformat=unix" +":wq" $i

done


如果有其他格式文件需要转换,可直接在红色标准括号内添加,或删除我已添加的文件类型的后缀名。

猜你喜欢

转载自blog.csdn.net/yaoshenjie/article/details/76412548
今日推荐