1.用file查看文件编码

[hadoop@Master ZhuJiangZaiXian]$ file vodall.csv
vodall.csv: UTF-8 Unicode (with BOM) text, with CRLF line terminators

2.用vi查看编码及更改编码格式

查看编码格式,用set fileencoding.
这是set fileencoding出来的结果
fileencoding
=utf-16le
设置文件的编码格式为utf-8
set fileencoding=utf-8
保存后退出,用file命令查看文件编码格式

[hadoop@Master ZhuJiangZaiXian]$ file temp.csv
temp.csv: UTF-8 Unicode (with BOM) text, with CRLF, CR line terminators

 程序猿必读

posted on 2015-03-11 20:03  龙种人  阅读(3507)  评论(0编辑  收藏  举报