Home  >  Article  >  Operation and Maintenance  >  Issues with Chinese garbled characters in VIM that you deserve to know about (share)

Issues with Chinese garbled characters in VIM that you deserve to know about (share)

奋力向前
奋力向前forward
2021-08-30 09:39:332378browse

In the previous article "In-depth analysis of mvc4 custom 404 page in asp.net (share)", we learned about the mvc4 custom 404 page in asp.net. The following article will help you understand the problem of Chinese garbled characters in VIM. Friends in need can refer to it. I hope it will be helpful to you.

Issues with Chinese garbled characters in VIM that you deserve to know about (share)

Problem

I found that many files were modified using the editor on window and then placed in Linux# After ## is uploaded, and then edited with VI, the Chinese characters will be garbled.

Yes, this is because the file encoding does not match the

vimeditor encoding. Just unify it.

Solution

Temporary solution

After opening

VI, enter:

:set encoding=utf-8

Permanent To take effect

In the current user directory, create a new

.vimrc file and add a line in it:set encoding=utf-8

cd ~
vi .vimrc
# 输入
:set encoding=utf-8

#退出保存
:wq

Recommended learning:

Linux video tutorial

The above is the detailed content of Issues with Chinese garbled characters in VIM that you deserve to know about (share). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:chuchur.com. If there is any infringement, please contact admin@php.cn delete