1,查看Unix的系统的编码(locale
命令):证实为UTF-8
LANG=en_GB.UTF-8
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC=en_GB.UTF-8
LC_TIME="en_GB.UTF-8"
LC_COLLATE=en_GB.UTF-8
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_ALL=en_GB.UTF-8
如果不是的话可以通过设置
export
LC_ALL=en_GB.UTF-8
将当前session的编码设为UTF-8
2,文件的编码确认为UTF-8,Unix的系统的编码也是UTF-8,为什么VI打开后显示的为乱码呢?问题出在Putty的设置,从Unix传输到Putty本地显示的过程也需要设置,Putty的菜单:
change
settings
-->
Window
-->Translation.将
'Received
data
assumed
to
be
in
which
character
set'选择为UTF-8.