Home >Operation and Maintenance >Linux Operation and Maintenance >How to deal with Chinese garbled characters in Linux Chinese text

How to deal with Chinese garbled characters in Linux Chinese text

coldplay.xixi
coldplay.xixiOriginal
2020-08-31 16:28:494357browse

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].

How to deal with Chinese garbled characters in Linux Chinese text

【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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more