Mint(Ubuntu)Linux終端中文顯示亂碼問題的解決

來源:互聯網
上載者:User

Mint(Ubuntu)Linux終端中文顯示亂碼問題的解決 0、安裝zhcon 1sudo apt-get install zhcon解決方案: 一. Ubuntu預設的中文字元編碼 Ubuntu預設的中文字元編碼為zh_CN.UTF-8,這個可以在/etc/environment中看到: sudo gedit /etc/environment可以看到如下內容:PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"LANG="zh_CN.UTF-8"LANGUAGE="zh_CN:zh:en_US:en" 第二行即是預設的中文字元編碼。註:可以通過這裡修改預設的中文編碼字元,比如修改為:zh_CN.GBK。 二. 添加中文字元編碼的方法1. 直接使用locale-gen在終端輸入命令:sudo locale-gen zh_CN.GB18030即可完成中文字元集的添加。完成後可以轉到 /usr/lib/locale/,下面已經有一個zh_CN.gb18030檔案夾;在超級終端輸入命令: gedit /var/lib/locales/supported.d/local,可以發現檔案中多了一行:zh_CN.GB18030 GB18030。說明添加成功。 2. 通過修改/var/lib/locales/supported.d/local檔案在終端輸入命令列sudo gedit /var/lib/locales/supported.d/local可以看到如下內容:1zh_CN.UTF-8 UTF-82en_US.UTF-8 UTF-8在檔案尾添加中文字元集 1zh_CN.GBK GBK儲存後退出。在終端輸入命令: 1sudo dpkg-reconfigure localesGenerating locales...en_AU.UTF-8... doneen_BW.UTF-8... doneen_CA.UTF-8... doneen_DK.UTF-8... doneen_GB.UTF-8... doneen_HK.UTF-8... doneen_IE.UTF-8... doneen_IN.UTF-8... doneen_NZ.UTF-8... doneen_PH.UTF-8... doneen_SG.UTF-8... doneen_US.UTF-8... doneen_ZA.UTF-8... doneen_ZW.UTF-8... donezh_CN.GBK... donezh_CN.UTF-8... up-to-datezh_HK.UTF-8... donezh_SG.UTF-8... donezh_TW.UTF-8... doneGeneration complete. 即可產生相應檔案:/usr/lib/locale/zh_CN.gbk/ 最後重啟ubuntu。
 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.