解决Ubuntu终端显示中文乱码的问题

解决Ubuntu终端显示中文乱码的问题

* 来源: * 作者: * 发表时间: 2020-06-17 0:26:44 * 浏览: 5
问题:Ubuntu终端显示中文乱码。配置与其他服务器相同。我不知道为什么该服务器显示中文乱码。 root @ localhost:〜ls-lh / etc / alternatives / vimlrwxrwxrwx1rootroot186814:48 / etc / alternatives / vim-gt,/ usr / bin / vim.basicroot @ localhost:〜ls-lh / etc / alternatives / vilrwxrwxrwx1rootroot186814:48 / etc /alternatives/vi-gt、/usr/bin/vim.basicroot@localhost:~more/etc/default/localeLANG=“,zh_CN.UTF-8”,LANGUAGE =“,zh_CN:zh”,LC_NUMERIC =“,zh_CN”,LC_TIME = quot; en_US.UTF-8quot; LC_MONETARY = quot; zh_CN.UTF-8quot; LC_PAPER = quot; zh_CN.UTF-8quot; LC_NAME = quot; zh_CN.UTF-8quot; LC_ADDRESS = quot; zh_CN.UTF-8quot; LC_TELEPHONE = quot,zh_CN.UTF-8quot,LC_MEASUREMENT =“,zh_CN.UTF-8quot,LC_IDENTIFICATION =”,zh_CN.UTF-8quot,root @ localhost:〜echo $ LANGzh_CN.UTF-8vim / etc / environment // Ubuntu默认中文字符编码PATH =”,/ usr / local / sbin:/ usr / local / bin:/ usr / sbin:/ usr / bin:/ sbin:/ bin:/ usr / games:/ usr / local / games”,LANG = quot,zh_CN.UTF-8quot,LANGUAGE =“ quot,zh_CN:zh:en_US:enquot,vim / var / lib / locales / supported.d / localzh_CN.UTF-8UTF-8en_US.UTF-8UTF-8zh_CN.GBKGBKlocale-genvim /等c / default / localeLANG =“,zh_CN.UTF-8”,LANGUAGE =“,zh_CN:zhquot,LC_NUMERIC =”,zh_CN“,LC_TIME =”,en_US.UTF-8“,LC_MONETARY =”,zh_CN.UTF-8“,LC_PAPER = quot,zh_CN.UTF-8“,LC_NAME =” quot,zh_CN.UTF-8“,LC_ADDRESS =”,zh_CN.UTF-8“,LC_TELEPHONE =”,zh_CN.UTF-8“,LC_MEASUREMENT =”,zh_CN.UTF-8“,LC_IDENTIFICATION = quot,zh_CN.UTF-8“,rebootapt-getupdate //此命令测试输出到终端中文消息的输出仍然无法正常显示答案:问题已解决!我几天来发现的信息是密不可分的!最后,确定与语言环境相关的变量是原因。 root @ localhost:~echo$LC_ALLzh_CN.GB18030root@localhost:~echo$LANGzh_CN.UTF-8root@localhost:〜exportLC_ALL =“ quot,quot,root @ localhost:〜echo $ LC_ALLroot @ localhost:〜apt-getupdate忽略http:/ /cn.archive.ubuntu.comsaucyInRelease忽略http://cn.archive.ubuntu.comsaucy-updatesInRelease忽略http://cn.archive.ubuntu.comsaucy-backportsInRelease忽略http://security.ubuntu.comsaucy-securityInRelease点击http ://cn.archive.ubuntu.comsaucyRelease.gpg问题已解决!看到您可以正常显示中文! !但是,以这种方式重现了重新启动计算机的问题,并提供了一个完整的解决方案:vim / etc / profileexportLC_ALL =“,quot,source / etc / profile