Linux终端中文乱码解决
Linux终端中文乱码解决,查看locale:在终端输入locale
# locale LANG=C 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=
修改LC_ALL变量
临时修改,在终端输入
export LC_ALL=zh_CN.UTF-8
永久修改,打开.bash_profile文件
vim ~/.bash_profile
添加如下行
export LC_ALL=zh_CN.UTF-8
使其生效
source ~/.bash_profile
Vim乱码问题解决,打开 vimrc 配置文件
vim ~/.vimrc
添加如下行:
set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1 set enc=utf8 set fencs=utf8,gbk,gb2312,gb18030
本站声明:网站内容来源于网络,如有侵权,请联系我们https://www.qiquanji.com,我们将及时处理。
微信扫码关注
更新实时通知