iconv 文件格式转换(gbk和utf8)

 iconv  -f UTF-8 -t GBK filename  -o xx.gbk.txt

 iconv  -f  GBK -t   UTF-8 filename  -o xx.utf8.txt

[root@redis22 ~]# cat 1
12io131
张三
[root@redis22 ~]# file 1
1: UTF-8 Unicode text
[root@redis22 ~]# iconv -f UTF-8 -t GBK 1 -o xx.gbk.txt

[root@redis22 ~]# file xx.gbk.txt
xx.gbk.txt: ISO-8859 text

把文件sz到本地用notepad++打开不会乱码

原文地址:https://www.cnblogs.com/hanxing/p/12408086.html