方法一:.添加encoding支持

(1)ubuntu的Applications菜单中默认没有配置编辑器选项,

首先添加,系统-》首选项-》主菜单-》系统工具,选中配置编辑器

(2)这是应用程序菜单中就有了配置编辑器

apps——gedit-2——preferences——encodings。
双击右边的“auto_detected”——点“添加”按钮——输入新列表值:“GB18030”并确定。

并up到第一项,完成

方法二 编写脚本

  1 #!/bin/bash
2 <<HELP
3 The script is used to change a dos text file
4 to a unix file
5 HELP
6
7 E_BADARGS=65
8 if [ -z "$1" ];then
9 echo "Usage:`basename $0` must have one or two arguments"
10 exit $E_BADARGS
11 fi
12
13 if [ -z "$2" ];then
14 NEWFILENAME=$1.unix
15 else
16 NEWFILENAME=$2
17 fi
18
19 iconv -f gbk -t utf-8 $1 >$NEWFILENAME  #gbk,gb2312 ,gb18030 字符集
20
21 echo "convert complete!"
22 exit 0
~

相关文章:

  • 2021-06-29
  • 2021-08-10
  • 2022-02-19
  • 2021-10-18
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2022-02-21
  • 2021-08-03
  • 2021-08-05
  • 2021-09-21
  • 2021-06-25
相关资源
相似解决方案