
gedit 自動檢測編碼列表缺少 GB18030 (國標擴展,兼容 GBK/GB2312),導致中文文件誤判為 UTF-8/ISO-8859 產生亂碼。
gconftool-2 --set --type=list --list-type=string \
/apps/gedit-2/preferences/encodings/auto_detected \
"[UTF-8,CURRENT,GB18030,BIG5-HKSCS,UTF-16]"


重新打開 gedit,亂碼消失。
gconf-editor 回車。/apps/gedit-2/preferences/encodings。auto_detected → 「編輯鍵值」。GB18030,確定。GB18030 連點「上移」移至列表頂部 (最高優先級)。










gsettings set org.gnome.gedit.preferences.encodings auto-detected \
"['UTF-8', 'CURRENT', 'GB18030', 'BIG5-HKSCS', 'UTF-16']"
gsettings set org.gnome.gedit.preferences.encodings shown-in-menu \
"['UTF-8', 'GB18030', 'BIG5-HKSCS', 'UTF-16']"
原理一致:將 GB18030 提升至自動檢測首位,確保中文舊文件優先按國標解碼。