Make ubuntu support GBK (1) first install the Chinese version of ubuntu after installation echo $ LANG is UTF-8 by default 1. modify/var/lib/locales/supported. d/local file, add zh_CN.GBK GBK zh_CN.GB2312 GB2312 2 to the file. sudo dpkg-reconfigure -- force locales. Then, the output result will show zh_CN.GB2312 done zh_CN.GBK done. done is successful, and then in the user's configuration file. set Export LANG = zh_CN.gbk (2) in profile to make VIM default GBK input although Ubuntu already supports GBK, the default input/display mode is still UTF-8, to change, we need to set them one by one. VIM bears the brunt. Before that, make sure that your vi has been upgraded to vim. Sometimes the system comes with vi instead of vim, you can run the following command to upgrade # apt-get install vim to open the VIM global configuration file # Add the following lines at the end of vim/etc/vim/vimrc file: let & termencoding = encoding set fileencodings = UTF-8, gb2312, gbkset encoding = gbk (3) let Terminal default GBK although VIM can already write/Open GBK files, but we found that it was still garbled during cat. In this case, we need to change the default encoding method of Terminal. On the terminal panel, choose termianl --> set character encoding --> add or remove from the menu bar, select GB2312 or GBK on the left, add it to the right, and close it. Then, select the added Chinese encoding in termianl --> set character encoding on the terminal panel, and then the Chinese will be displayed normally.