Ubuntu text editor opens Chinese garbled characters

Source: Internet
Author: User

Method 1:

In Ubuntu, gedit is used to open the. Txt file. The default gedit encoding is UTF8. The gb2312 files edited in windows are garbled. {the default file format in Windows is GBK (gb2312 ), (GBK encoding is a superset of GB2312 encoding and is fully compatible with GB2312 .)}. The solution is to change the default code of gedit to GB2312.

Choose application> System Tools> configuration editor. If not, open system> Preferences> Main Menu> System Tools> configuration editor.


Open/apps/gedit-2/preferences/encodings/double-click auto_detected on the right, and click Add in the pop-up dialog box, add the value GB2312 (change the gedit recognized encoding to the top GB2312 when editing the document in windows), click OK, and add GB18030, GBK, click the "Up" button to move GB18030 to the first (first preferred ). Similarly, set show_in_menu and place GB18030 first.

Then open the. Txt file.
Method 2:


Enable the application select the openoffice text processing program as shown in the figure.

FILE-open the txt file you want to open. When it is opened, a window will pop up asking you what types of characters to select. As shown in the figure, select Simplified Chinese (GB18030). (the GB18030 encoding is backward compatible with GBK and GB2312. The compatibility means not only character compatibility, but also the same character encoding .) It will be displayed normally. You only need to ask each time.
As shown in the following figure:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.