Home >Operation and Maintenance >Linux Operation and Maintenance >vi in ​​linux displays garbled Chinese characters

vi in ​​linux displays garbled Chinese characters

王林
王林Original
2020-02-14 14:45:234374browse

vi in ​​linux displays garbled Chinese characters

Cause analysis:

Because the default is gb encoding under windows, and my vim defaults to utf-8 (gedit defaults to utf-8), so open It will become gibberish. Just modify the configuration file so that vi supports gb encoding.

(Online learning video sharing: linux video tutorial)

The specific method is as follows:

$vi ~/.vimrc 
let &termencoding=&encoding 
set fileencodings=utf-8,gbk 
$:wq

Open vi again, and the display will be normal.

Related recommendations: linux tutorial

The above is the detailed content of vi in ​​linux displays garbled Chinese characters. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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