首页 > 窍门 > 科技数码

CentOS设置文件字符编码的方法 centos查看文件编码

来源: 更新时间:2023-09-03 00:19:20
The Beginning

  1、查看文件字符编码onc育儿早教网

  ###using file command###onc育儿早教网

  [root@ipython report]# file --mime-encoding analysis.csvonc育儿早教网

  analysis.csv: utf-8onc育儿早教网

  ###using vim command###onc育儿早教网

  [root@ipython report]# vim analysis.csvonc育儿早教网

  :set fileencodingonc育儿早教网

  fileencoding=utf-8onc育儿早教网

  2、设置文件字符编码onc育儿早教网

  ####using iconv command####onc育儿早教网

  syntax:onc育儿早教网

  iconv -f old_encoding -t new_encoding filenameonc育儿早教网

  ###example###onc育儿早教网

  [root@ipython report]# iconv -f utf-8 -t gbk analysis.csv > new_analysis.csvonc育儿早教网

  ###using vim command###onc育儿早教网

  :set fileencoding=gbkonc育儿早教网

  :wq!onc育儿早教网

THE END

TAG:字符  文件  wq  

猜你喜欢

相关文章