iconv编码转换

iconv转换文件内容

适合内容转换

查看编码是否支持

iconv -l | grep US

1
2
3
4
5
6
7
8
9
10
CSEBCDICUS//
CSISO141JUSIB1002//
EBCDIC-CP-US//
EBCDIC-US//
EBCDICUS//
ISO646-US//
JUS_I.B1.002//
RUSCII//
US-ASCII//
US//

转换编码为UTF-8

转换加-c参数要不然报错

1
2
iconv -f US-ASCII D13100031.201807o.txt -t UTF-8 -o test
iconv -f US-ASCII D13100031.201807o.txt -t UTF-8 -c -o test


conv

对当前名称没有乱码的转换
convmv -f GBK -t utf8 –notest -r .


unar

解压加转化 推荐

unar解压消除乱码

unar -help

1
2
3
-encoding (-e) <encoding name>     

The encoding to use for filenames in the archive, when it is not known. If not specified, the program attempts to auto-detect the encoding used. Use "help" or "list" as the argument to give a listing

列出具体支持的编码

unar -e help

1
2
3
4
5
unar -e list | grep -i "GB"
* gb18030
* GBK (CP936, MS936, windows-936)
* GB2312 (csGB2312)
* GB_2312-80 (chinese, iso-ir-58, csISO58GB231280)

创建解压目录并解压

mkdir exdir;unar -e GBK file.zip -o exdir


版权声明: 署名非商用CC BY-NC 4.0