Make ubuntu support GBK

Source: Internet
Author: User

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.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.