utf-8中文在source insight中显示为乱码,写了一个简单脚本,在linux下将代码转换为GBK格式,然后在source insight下正常查看。

 

#!/bin/sh

function conv() {
	echo "Converting $1"
	enca -L zh_CN -x GBK $1
}

function walk() {
for file in `ls $1`
	do 
		if [ -d $1"/"$file ]
		then 
			walk $1"/"$file
		else 
			conv $1"/"$file
		fi
	done
}

walk $1


保存为conv.sh 使用方法 ./conv.sh dir

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-07-16
  • 2021-10-17
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2021-07-30
  • 2021-06-17
  • 2022-12-23
  • 2022-01-03
  • 2021-12-07
  • 2021-09-11
相关资源
相似解决方案