Solve vim garbled characters in centos
My system is centos 6.8
UTF-8 is selected for xhsf-connection.
When I use vim for editing, Chinese characters always show garbled characters. Although cat is normal, it is inconvenient for editing.
The Chinese Character in vim is garbled.
Solution:
Use yum grouplist to find the Chinese support, download it, and set the language to Chinese.
[Plain] view plaincopy
- Yumgrouplist
- Yumgroupinstall "ChineseSupport"
Then, it takes effect temporarily:
[Plain] view plaincopy
- LANG = zh_CN.utf-8
To take effect permanently:
[Plain] view plaincopy
- Vim/etc/sysconfig/i18n
Replace the sentence.
[Plain] view plaincopy
- LANG = zh_CN.utf-8
:
Install
Temporary effect:
Permanently effective: set it in/etc/sysconfig/i18n. After setting it, exit and check it again.
If the problem persists, try other methods:
Http://blog.chinaunix.net/zt/1020/linuxvibian_1020085.shtml