ubuntu gedit 開啟 windows 分區中txt 檔案亂碼,ubuntugedit

來源:互聯網
上載者:User

ubuntu gedit 開啟 windows 分區中txt 檔案亂碼,ubuntugedit

http://blog.csdn.net/pipisorry/article/details/39482861

ubuntu 12.04 gedit 開啟 windows 分區中的txt 檔案亂碼,是因為 ubuntu 和 windows 兩個系統的編碼不同。

解決辦法1:(推薦)

終端裡依次輸入以下 2 條命令即可:

gsettings setorg.gnome.gedit.preferences.encodings auto-detected "['GB18030','GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT','UTF-16']"

gsettings setorg.gnome.gedit.preferences.encodings shown-in-menu "['GB18030','GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT','UTF-16']"


解決辦法2:

1、在終端輸入“dconf-editor”斷行符號。(如果沒有安裝用“sudo apt-get install dconf-tools”安裝。)

2、展開org/gnome/gedit/preferences/encodings

auto-detected的value中加入 'GB18030', 加在uft8後面,按斷行符號;

show-in-menu的value中在前面加入 'GB18030', 按斷行符號。



from:http://blog.csdn.net/pipisorry/article/details/39482861

ref:http://blog.sina.com.cn/s/blog_455c7a600101a7w7.html

Ubuntu 12.04下Gedit開啟Windows下txt檔案亂碼解決

ubuntu下txt文檔亂碼現象


為何windows下的txt到ubuntu下是亂碼,而ubuntu下的txt在windows下也出現亂七八糟的字元?

兩個方法:

命令列方式,適用於所有 Ubuntu 使用者。
複製以下命令到終端中,然後斷行符號即可:

gconftool-2 --set --type=list --list-type=string /apps/gedit-2/preferences/encodings/auto_detected "[UTF-8,CURRENT,GB18030,BIG5-HKSCS,UTF-16]"

圖形化方式,適用於 Ubuntu 使用者,而不適用於 KUbuntu/XUbuntu 使用者。
您可以遵循以下步驟,使您的 gedit 正確顯示中文編碼檔案。

按下 Alt-F2,開啟“運行應用程式”對話方塊。
在文字框中鍵入“gconf-editor”,並按下斷行符號鍵,開啟“配置編輯器”。
展開左邊的樹節點,找到 /apps/gedit-2/preferences/encodings 節點並單擊它。
雙擊右邊的 auto_detected 鍵,開啟“編輯按鍵”對話方塊。
單擊列表右邊的“添加”按鈕,輸入“GB18030”,單擊確定按鈕。
列表的最底部新增加了一個“GB18030”。單擊選中它,並單擊右邊的 “向上” 按鈕直到 “GB18030” 位於列表的頂部為止。
單擊確定按鈕,關閉配置編輯器。
現在,您的 gedit 應該能夠順利開啟 GB18030 編碼的文字檔了。
 
Ubuntu 1004 中開啟c檔案,文中漢字亂碼為何,怎解決?還有txt也有類似情況

你右擊主菜單,在系統工具中把組態管理員選中,然後運行它,在app中找到gedit(具體記不起了,大概是這個樣子)然後將其編碼改成gb2312就可以了。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.