Home >Backend Development >PHP Tutorial >PHP gvim Chinese garbled code analysis solution_PHP tutorial

PHP gvim Chinese garbled code analysis solution_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:54:421106browse

Started studying the gvim configuration file (_vimrc), and now I will show you the configuration before I generated garbled characters

The meaning of encoding, fileeconding and fileecondings in the configuration file:
encoding: The character encoding used internally by gvim, including vim's buffer, menu text, message text, etc.
The user manual recommends changing its value only in .vimrc, and in fact it seems that it only makes sense to change its value in .vimrc.
fileencoding: The character encoding of the file currently edited in gvim. When vim saves the file, it will also save the file in this character encoding (regardless of whether it is a new file or not).
fileencodings: When gvim starts, it will detect the character encoding of the file to be opened one by one according to the character encoding it lists, and set fileencoding to the final detected character encoding.
Therefore it is best to put the unicode encoding at the top of the list and the Latin encoding latin1 at the end.
Among them: chinese is the cp963 encoding
At this point, I suddenly remembered that the default character set in my browser is gbk, and the encoding set in _vimrc is utf-8. The two do not correspond,

colors desert
set nobackup
set guifont=courier_new:h12:cansi
"Handling text with garbled characters
set encoding=utf-8
set fileencodings=chinese
set fileencoding=chinese
"Handle menu and right-click menu garbled characters
source $vimruntime/delmenu.vim
source $vimruntime/menu.vim
"Processing console output garbled code
language messages zh_cn.utf-8
syntax enable
syntax on

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632299.htmlTechArticleStarted studying the gvim configuration file (_vimrc). Now I will show you the configuration file before I generated garbled characters. The meaning of encoding, fileeconding, fileecondings: encoding: gvim internal...
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