Home > Operation and Maintenance > Linux 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)

奋力向前
Release: 2021-08-30 09:39:33
forward
2395 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:chuchur.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template