problem causes
The default editor in Ubuntu 18.04 is Gedit. If the English version is installed or the character encoding is not set, the Chinese in the TXT file will display garbled characters.
Install dconf-tools
sudo apt-get install dconf-tools
Open dconf-editor
dconf-editor
Add character encoding
开org/gnome/gedit/preferences/encodings/candidate-encodings
Set Use Default value to Off
Add content in Custom value
[‘UTF-8′,’GB18030′,’GB2312′,’GBK’,’BIG5′,’CURRENT’,’UTF-16′]
Command direct modification
Zoom in, here just enter the following command in the terminal to perfectly fix the txt garbled problem.
gsettings set org.gnome.gedit.preferences.encodings candidate-encodings "['GB18030', 'UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']"