Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solve the problem of Chinese garbled code displayed by xshell and vim

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Open a Chinese file encoded with utf8. In vim, you can display Chinese normally after executing: set encoding=utf-8 termencoding=gbk fileencoding=utf-8.

Explanation:

Encoding is the current encoding of the setting file

Termencoding is the display code for the vim screen, and since the default code for the display screen of xshell is gbk, this is set to gbk. By the same token, if you change the default encoding of xshell to utf-8, it should naturally be utf-8 here.

The code of the fileencoding file when it is saved, which should be consistent with the encoding, otherwise a warning will pop up

As for xshell, open file- > Properties, click on the Terminal node, modify Terminal Type to linux (keyboard mapping mode, default to xtrem, this mode for vim keypad input numbers will appear scrambled symbols), modify Encoding to uft-8 (in general, the linux system uses this code, you can use the locale command to view the default code of your system, modify to consistent on the line).

By the same token, you can also change the encoding of xftp to utf-8 to display Chinese normally.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report