首页 > 其他 > 详细

iconv命令

时间:2018-07-09 12:15:38      阅读:232      评论:0      收藏:0      [点我收藏+]
iconv命令:

Convert encoding of given files from one encoding to another,更改文件的编码格式

语法格式:

iconv -f encoding -t encoding inputfile

常用选项:

-f encoding :把字符从encoding编码开始转换
-t encoding :把字符转换到encoding编码

-l 列出已知的编码字符集合 

-o file :指定输出文件 

-c :忽略输出的非法字符 

-s :禁止警告信息,但不是错误信息

实例:

[root@www1 ~]# iconv test.txt -f UTF-8 -t gbk
?????
?????
??????
??????
??????
??????
??????
You have mail in /var/spool/mail/root
[root@www1 ~]# iconv test.txt -c -f UTF-8 -t gbk
?????
?????
??????
??????
??????
??????
??????
[root@www1 ~]# iconv test.txt -c -f UTF-8 -t gbk -o testt.txt
You have mail in /var/spool/mail/root
[root@www1 ~]# cat testt.txt
?????
?????
??????
??????
??????
??????
??????


iconv命令

原文:http://blog.51cto.com/12107790/2139092

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!