写一个脚本批量转换项目中GB2312编码的文件为UTF-8编码

mac2022-06-30  91

#!/bin/bash convert_file() { for file in `find .` do if [[ -f $file ]] then if [[ ${file##*.} == lua || ${file##*.} == ini ]]; then cp $file $file".bak" iconv -f GB2312 -t UTF-8 $file > $file echo $file fi fi done } convert_file

转载于:https://www.cnblogs.com/praglody/p/9249741.html

相关资源:UTF-8与GB2312文件编码转换(支持批量文件)
最新回复(0)