电脑教程
位置:首页>> 电脑教程>> 软件教程>> CentOS设置文件字符编码的方法

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

  发布时间:2022-05-14 10:21:26 

标签:CentOS,文件字符编码

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

1、查看文件字符编码

###using file command###

[root@ipython report]# file --mime-encoding analysis.csv

analysis.csv: utf-8

###using vim command###

[root@ipython report]# vim analysis.csv

:set fileencoding

fileencoding=utf-8

2、设置文件字符编码

####using iconv command####

syntax:

iconv -f old_encoding -t new_encoding filename

###example###

[root@ipython report]# iconv -f utf-8 -t gbk analysis.csv > new_analysis.csv

###using vim command###

:set fileencoding=gbk

:wq!

0
投稿

猜你喜欢

手机版 电脑教程 asp之家 www.aspxhome.com