解决source insight不能查看utf8代码的问题 2012

第一种:

(1)source insight 阅读VC++源码,注释为乱码解决方案

1、options->preferences->Syntax Formatting->Styles;
2、在Style Name 选择 Comment,再对其Font Name 选择Pick,然后再选择“新宋体”。

(2)source insight 阅读Linux源码,注释为乱码解决方案

1、用记事本打开源文件,中文可以显示,我另存为,在保存选项中,编码一栏发现是:UTF-8。我选在ANSI一项,保存。再用Source Insight 打开,终于可以显示了


第二种:

在linux终端执行以下脚本

使用:./transform.sh 参数1 参数2
参数1为待转码路径,参数2为转码后路径(确认存在),转码后的目录层次结构同转码前。

然后可将代码下载到windows机器进行查看。

transform.sh内容如下:

  1. #!/bin/bash

  2. function fun_dir(){
  3. for child in `ls $1`
  4. do
  5.     if [[ -f $1/$child ]]
  6.     then
  7.         echo "convert $1/$child"
  8.         iconv -f utf--t gb2312 $1/$child > $2/$child
  9.         if (( $? != 0 ))
  10.             then
  11.                 cp $1/$child $2/$child
  12.                 echo "cp $1/$child $2/$child"
  13.             fi
  14.     elif [[ -d $1/$child ]]
  15.     then
  16.         mkdir $2/$child
  17.         fun_dir $1/$child $2/$child
  18.     fi
  19. done
  20. }

  21. if (( $# != 2 ))
  22.     then
  23.     echo "parameter error"
  24.     exit
  25.     fi

  26. fun_dir ${1%/} ${2%/}




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值