本篇文章讲解在linux平台下合理使用中国知网的方式,包括:论文下载,文件名乱码处理等内容,并提供相应代码。
(1)论文下载
背景:由于cnki并未提供linux平台下的caj阅读器,同时使用模拟器运行caj阅读器则可能造成程序崩溃和内容乱码等的问题,使广大使用者深感痛楚,接下来讲解如何快捷下载pdf格式文档,而非cnki推荐的caj格式文档的方法。
1)进入浏览器插件管理页面,搜索:Greasemonkey,下载并安装油猴子浏览器插件。安装后请重启浏览器。
2)点击下方链接进入Greasemonkey脚本下载页面,浏览器将自动安装脚本。
3)点击下载图标,可直接下载pdf格式文档,而非cnki所默认的caj格式文档。同时博硕士论文下载选项处出现PDF下载选项。
(2)文件名称乱码处理
Linux系统下可推荐 convmv 程序进行文件名编码格式转换。
首先安装并安装 convmv 程序,方式为:
aro@ZAKER:~$sudo apt install convmv
注:该方式适用于Ubuntu系统,其他Linux系统的下载方式与此类似。
以下为convmv的帮助文档:
CONVMV(1)
NAME
convmv -converts filenames from one encoding to another
SYNOPSIS
convmv[options] FILE(S) ... DIRECTORY(S)
OPTIONS
-f ENCODING
specifythe current encoding of the filename(s) from which should beconverted
-t ENCODING
specifythe encoding to which the filename(s) should be converted
--nosmart
bydefault convmv will detect if a filename is already UTF8 encoded andwill skip this file if conversion from some charset to UTF8 should beperformed. "--nosmart" will also force conversion to UTF-8for such files, which might result in "double encoded UTF-8"(see section below).
--nosmart
bydefault convmv will detect if a filename is already UTF8 encoded andwill skip this file if conversion from some charset to UTF8 should beperformed. "--nosmart" will also force conversion to UTF-8for such files, which might result in "double encoded UTF-8"(see section below).
使用方式较简单,可将大部分cnki下载文文件名进行编码转换。
使用方式为:
1)到达文件所在目录。
aro@ZAKER:~$cd ./file
2) 运行代码:
aro@ZAKER:~/file$convmv -r -f utf8 -t iso88591 * --nosmart && convmv -r -f gbk -t utf8 * --nosmart
以测试能够进行转化操作,同时在操作3进行之前请备份文件。
3)运行代码:
aro@ZAKER:~/file$convmv -r -f utf8 -t iso88591 * --notest --nosmart && convmv -r -f gbk -t utf8 * --notest --nosmart
以非测试的方式进行转化,注意这种方式可能会破坏文件。
以Ubuntu 16.04系统convmv 2.0程序下的使用方式为例:
同时注意单纯使用convmv -r -f gbk -t utf8 * --notest –nosmart或convmv -r -f utf8 -t iso88591 * --notest--nosmart命令并不能实现乱码问题的解决。