Debain中文亂碼及新增中文支援

2021-07-12 08:04:19 字數 531 閱讀 5840

用vnc遠端連線debain伺服器發現中文顯示好多方塊,看著很不舒服,於是在網上海淘並整理了如何在debain中新增中文支援以及新增中文輸入法:

1、生成locales:

執行 dpkg-reconfigure locales,選擇上以下選項:

接下來要安裝中文字型,一共有以下幾個包需要安裝:

前面兩個是簡體的,後面兩個是繁體的,但是最好都裝上,否則到時候很可能亂碼。

執行:sudo apt-get install ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-bsmi00lp ttf-arphic-bkai00mp 

安裝中文輸入法:(推薦ibus)

sudo apt-get install ibus

sudo apt-get install  ibus-pinyin

system tools -> preferences -> input method 中新增中文拼音

最後記得重啟圖形終端,再次開啟就ok了!

如下圖所示:

debain 解決無法顯示中文

首先先配置編碼 vim etc locale.gen 去掉前面的 en us.utf 8 utf 8 zh cn gb2312 zh cn.gbk gbk zh cn.utf 8 utf 8 設定 lang en us.utf 8 然後安裝語言包 apt get install ttf arphic...

qt 中文亂碼 Qt中文亂碼問題

接觸了qt,由於習慣中vs,如果使用vs寫qt 剛接觸很快就發現有中文亂碼問題,我的解決方法如下 新建乙個標頭檔案,比如qtchcharset.h,標頭檔案中內容如下 pragma once ifdef q os win q os win 新增後支援gb2312,utf 8 bom,unicode ...

vim輸入中文亂碼及開啟中文檔案亂碼的問題

之前在編寫python 的時候,也曾遇到過輸入中文亂碼的問題,就算能夠輸入,只要游標在文字上面移動過,就會變成亂碼。網上找到的答案都是新增encoding,fileencoding及termencoding這三項,即是在.vimrc下新增下面三行 set fileencodings utf 8,gb...