Garbled characters After Vim is opened, and garbled characters After xshell is opened

Source: Internet
Author: User

Xshell is a very good tool for embedded development. However, it may be a bit uncomfortable to see Chinese characters as garbled characters. The solution is actually very simple, that is, to change the xshell encoding method to UTF-8.

[File]-> [open]-> In the Open Session select the connection that, click [properties]-> [terminal], encoding: Unicode (UTF-8 ), then you can reconnect to the server. You can also click the "encoding" button in the toolbar of xshell and select Unicode (UTF-8) encoding.

 

 

When Vim is used, Chinese characters are garbled. In this case, we can modify the vimrc file to solve the problem!

First, you need to find out where vimrc is located. In general, in Linux

Linux:/usr/share/Vim/vimrc

In Windows, it should be in the vim installation directory

Windows: C: \ Program Files \ Vim \ vimrc I am currently using windows7, the path is displayed

C: \ Program Files \ Vim \ _ vimrc

This is all about global settings. After opening the vimrc file, you only need to add the following code at the end of the file:

Set fileencodings = UTF-8, gb2312, GBK, gb18030

Set termencoding = UTF-8

Set fileformats = Unix

Set encoding = PRC

 

In this way, your vim Chinese garbled problem is solved!

Garbled characters After Vim is opened, and garbled characters After xshell is opened

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.