問題の原因
Ubuntu 18.04のデフォルトのエディターはGeditです。英語版がインストールされているか、文字エンコードが設定されていない場合、TXTファイルの中国語に文字化けが表示されます。
dconf-toolsをインストールする
sudo apt-get install dconf-tools
dconf-editorを開く
dconf-editor
文字エンコーディングを追加する
开org / gnome / gedit / preferences / encodings / candidate-encodings
[デフォルト値を使用]を Off
カスタム値にコンテンツを追加する
[‘UTF-8′,’GB18030′,’GB2312′,’GBK’,’BIG5′,’CURRENT’,’UTF-16′]
コマンドの直接変更
ズームインします。ここでは、ターミナルで次のコマンドを入力するだけで、txtの文字化けの問題を完全に修正できます。
gsettings set org.gnome.gedit.preferences.encodings candidate-encodings "['GB18030', 'UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']"