Chinese garbled characters in Linux, securecrt and VIM

Source: Internet
Author: User

First check securecrt,

Set

Options-> Global Options-> General-> default session-> edit default settings-> terminal->

Appearance-> character encoding,

Select UTF-8

Then set

Options-> Global Options-> General-> default session-> edit default settings-> terminal->

Appearance-> font,

Select a font that does not contain garbled Chinese characters, such as fixedsys,, and.

Then exit securecrt and log on again.

Because the default Linux encoding is UTF-8, at this time, Chinese characters can be displayed normally.

 

The default encoding of securecrt is GBK, which is basically the same as that of windows. Therefore, changing to UTF-8 will cause some Chinese prompts of Linux to become garbled characters. One solution is not to modify the default securecrt encoding so that the securecrt encoding is still GBK. Solve the problem of Chinese garbled characters in the UTF-8 format in VIM by setting vim.

 

Vim settings are in the vimrc file and under the/etc directory of the system. In addition ~ If a. vimrc file also exists in the directory, the system will configure it according to the file.

Edit. vimrc (_ vimrc), and add:

Let $ lang = "zh_CN.UTF-8"

Set fileencodings = UTF-8, Chinese, Latin-1

Set termencoding = GBK

Set fileencoding = UTF-8

Set encoding = UTF-8 and then OK.

If similar settings already exist in the configuration file, modify the settings as needed.

 

If the code is still garbled, continue to check Linux settings

Open/etc/sysconfig/i18n

Change Lang to a character set that supports UTF-8

For example: lang = "zh_CN.UTF-8 ″

Or lang = "en_US.UTF-8 ″

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.