登录的时候出现invalid utf-8错误,以及出现其它中文乱码解决方案:
- 在终端输入:locale
查看是否是中文编码
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
- 永久使用中文(将/etc/locale.conf文件修改)
终端依次输入:
vi /etc/locale.conf //编辑locale.cnf
i //进入命令行模式
---
//把内容修改成如下
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN.zh_CN.UTF-8:zh_CN.zh_CN.UTF-8:zh_CN"
SUPPORTED="zh_CN.zh_CN.UTF-8:zh_CN:zh"
SYSFONT="latarcyrheb-sun16"
---
esc //进入命令行模式
:wq //保存退出
重新启动服务器