Ubuntu uses gedit and VIM to enable garbled TXT files

Source: Internet
Author: User

I wrote the first csdn log today to commemorate it. Haha, start your own technology path. Haha ~~

1) gedit

. Run gconf-editor, modify the automatic detection encoding settings of gedit, and add several gb18030, gb2312, and GBK (gb18030 is compatible with gb2312 and GBK, so you only need to add one gb18030)
Under this option/apps/gedit-2/preferences/encodings/auto_detected

Me
The default encoding of the system is
UTF-8, after gb18030 is added. But be sure to put it in front of the locale supported by your system. See how to add gb18030
Locale support. Someone said that he called the function of the glib library to determine the encoding. If you do not install locale in your system, it may be a problem during detection.
Gb18030 put at the top of the line, because my system at first only UTF-8 support, so the first order
UTF-8, ISO-8859-15, gb18030
In this way, he still cannot recognize the gb18030 encoding.
UTF-8, gb18030, ISO-8859-15 as if.
2) Vim
Similarly, you can add set fencs = UTF-8, gb18030, ucs-bom, default, Latin1 to the/etc/Vim/gvimrc file.
This line allows the gvim editor to automatically detect the encoding. In gvim, click "edit"-"" set window "to view help.

 

From: http://blog.csdn.net/stephen_law/archive/2010/07/14/5733763.aspx

Related Article

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.