Solution to Chinese garbled text in Linux: First open the terminal and enter the directory where the file is located; then use the command command to convert gb18030 encoded [a.hpp] into utf8 [b.hpp].
【Recommended related articles: linux tutorial】
Solution to Chinese garbled text in Linux:
Method A (single file setting)
1. Open the terminal , enter the directory where the file is located.
2. Use the command symbol
$ iconv -f gb18030 -t utf8 a.hpp -o b.hpp
to convert gb18030 encoded a.hpp into utf8 b.hpp. In this way, b.hpp becomes an encoding supported by Linux. Setup completed.
Method B (overall setting)
1. Open the terminal and execute the following command to open the environment setting interface:
$ gconf-editor
If it prompts that gconf is not installed -editor, use apt-get to install, the command is as follows:
sudo apt-get install gconf-editor
2. Expand "/apps/gedit-2/preferences/encodings/" in turn, edit "auto_detected" on the right and add "gb18030" Go to the top. Setup completed.
If you want to know more about programming learning, please pay attention to the php training column!
The above is the detailed content of How to deal with Chinese garbled characters in Linux Chinese text. For more information, please follow other related articles on the PHP Chinese website!