Solution to Garbled text files in Ubuntu

Source: Internet
Author: User
I found two simple solutions on the Internet: the first method:
Principle (I have written too many practical training reports over the past few days and want to write everything into the principle): gedit is used to open the. txt file in ubuntu.pdf, and the default gedit encoding is utf8, the gb2312 files edited in windows are garbled characters {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 gedit encoding to gb2312.

Choose Application> System Tools> Configuration editor. If not, open system> preferences> Main Menu> System Tools> Configuration editor.
(Shell: gconf-editor)
For example, open/apps/gedit-2/preferences/encodings/double-click auto_detected on the right, in the pop-up dialog box, click Add, add the value gb2312 (change the default gedit encoding to the top gb2312 when editing the document in Windows), click OK, and click the up button to move it to the first place (first preferred ). Similarly, set show_in_menu and set gb2312 to the first place.
Then open the. txt file.
Or:
Terminal input: gconf-Editor
Open in turn; apps-gedit2-preferences-encodings
Double-click "auto_detected" on the right -- "double-click" -- input: gb18030 -- up to the top -- OK
Double-click "show_in_menu" -- "double-click" -- input: gb18030 -- up to top -- OK
Method 2:
Open the application in turn-office-selected OpenOffice Text Processing Program
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. Select Simplified Chinese (gb18030). (gb18030 is backward compatible with GBK and gb2312. Compatibility means not only character compatibility, but also the same character encoding .) It will be displayed normally. You only need to ask each time.


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.