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)

William Shakespeare
William Shakespeare forward
2021-08-30 09:39:33 2293browse

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 onwindowand then placed inLinux# After ## is uploaded, and then edited withVI, 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

.vimrcfile 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