#!/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
# @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
如果有其他格式文件需要转换,可直接在红色标准括号内添加,或删除我已添加的文件类型的后缀名。