1、查看文件字符编码
###using file command###文章源自网吧系统维护-https://www.58pxe.com/7772.html
[root@ipython report]# file –mime-encoding analysis.csv文章源自网吧系统维护-https://www.58pxe.com/7772.html
analysis.csv: utf-8文章源自网吧系统维护-https://www.58pxe.com/7772.html
###using vim command###文章源自网吧系统维护-https://www.58pxe.com/7772.html
[root@ipython report]# vim analysis.csv文章源自网吧系统维护-https://www.58pxe.com/7772.html
:set fileencoding文章源自网吧系统维护-https://www.58pxe.com/7772.html
fileencoding=utf-8文章源自网吧系统维护-https://www.58pxe.com/7772.html
2、设置文件字符编码文章源自网吧系统维护-https://www.58pxe.com/7772.html
####using iconv command####文章源自网吧系统维护-https://www.58pxe.com/7772.html
syntax:文章源自网吧系统维护-https://www.58pxe.com/7772.html
iconv -f old_encoding -t new_encoding filename文章源自网吧系统维护-https://www.58pxe.com/7772.html
###example###文章源自网吧系统维护-https://www.58pxe.com/7772.html
[root@ipython report]# iconv -f utf-8 -t gbk analysis.csv > new_analysis.csv文章源自网吧系统维护-https://www.58pxe.com/7772.html
###using vim command###文章源自网吧系统维护-https://www.58pxe.com/7772.html
:set fileencoding=gbk文章源自网吧系统维护-https://www.58pxe.com/7772.html
:wq!文章源自网吧系统维护-https://www.58pxe.com/7772.html 文章源自网吧系统维护-https://www.58pxe.com/7772.html
评论