Processing of Linux text editing garbled problem

Source: Internet
Author: User

Set the vim character set, in order to determine whether Vim is not a character set problem, can be used after vim file: set Encoding=utf8 see if it can be displayed properly. The ultimate solution to vim garbled is to change the environment variables of VIM, as follows:

VI ~/.VIMRC Add set Encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936 then save, then vim with Chinese files you find garbled problem no

The UNIX developer decided to use a <LF> character to denote the end of the line.
Apple developers have defined <CR>.
the development of MS-DOS (Windows) developers decided to follow <CR><LF>.
This means that moving a file from one system to another has the trouble of line breaks. such as: Use VI to try to edit a file in MS-DOS format, you will find the end of each line has a ^m character. (^m is <CR>).
set Ff=unix, which is to tell the VI editor to use UNIX line breaks
set Ff=dos, which is to tell the VI editor to use DOS line breaks


This article from "It Technology" blog, declined reprint!

Processing of Linux text editing garbled problem

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.