Solve the Problem of Gedit Chinese garbled characters and vim Chinese garbled characters in Ubuntu11.04 (txt)

Source: Internet
Author: User
Today, the txt file opened in Ubuntu11.04 is garbled, so I searched a lot on the Internet and said almost everything: terminal-gconf-editor-& gt; apps-& gt; gedit-2-& gt; preferences-& gt; encodings-& gt; auto_detected-& gt; added gbk, gb18030 top, but still did not solve the garbled problem. This is also true in sudogconf-editor.

Today, I opened the txt file in Ubuntu 11.04 and found it garbled. So I searched a lot on the Internet, all of which are similar:

As follows:

Terminal-gconf-editor-> apps-> gedit-2-> preferences-> encodings-> auto_detected-> Add gbk, gb18030 top, but still does not solve the garbled problem. Sudo gconf-editor does the same, but it does not solve the garbled problem.

The following method is feasible:

Gedit -- encoding gbk mytest.txt

However, it is inconvenient to use the following method:

Gconftool-2 -- set -- type = list -- list-type = string/apps/gedit-2/preferences/encodings/auto_detected "[UTF-8, CURRENT, GB18030, BIG5-HKSCS, UTF-16]"

Feasible.

But now I have doubts, why is the first solution not feasible? Is www.linuxidc.com a problem in the txt format ???

Vim Chinese garbled solution:

Terminal-"vim ~ /. Enter vimrc.

Let & termencoding = & encoding

Set fileencodings = UTF-8, gbk

This is feasible.

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.