Solve the Problem of garbled Chinese Characters in Ubuntu.

Source: Internet
Author: User
I first installed Ubuntu12.04Server and then installed the desktop. A problem occurs in Chinese. Solution: 1. ubuntu default Chinese character encoding for zh_CN.UTF-8, this can be seen in/etc/environment: sudogedit/etc/environment can see the following content: PATH = "/usr/local/sbin:/usr/local/bin:/us

I first installed Ubuntu 12.04 Server and then installed the desktop. A problem occurs in Chinese.

Solution:
I. Ubuntu default Chinese character encoding
Ubuntu default Chinese character encoding for zh_CN.UTF-8, this can be in
/Etc/environment:
Sudo gedit/etc/environment
You can see the following content:
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
LANG = "zh_CN.UTF-8"
The second line of LANGUAGE = "zh_CN: zh: en_US: en" is the default Chinese character encoding. Note: you can modify the default Chinese character encoding here, for example, zh_CN.GBK.

2. How to add Chinese character encoding
1. Use locale-gen directly
Enter the following command on the terminal:
Sudo locale-gen zh_CN.GB18030
The Chinese character set can be added. You can go
/Usr/lib/locale/, which has a folder named zh_CN.gb18030. Enter the following command on the Super Terminal:
Gedit/var/lib/locales/supported. d/local, you can find a row in the file: zh_CN.GB18030 GB18030. It indicates that the application is successfully added.

2. Modify the/var/lib/locales/supported. d/local file
Enter the command line in the terminal
Sudo gedit/var/lib/locales/supported. d/local
You can see the following content:
Zh_CN.UTF-8 UTF-8
En_US.UTF-8 UTF-8
Add a Chinese character set at the end of the file
Zh_CN GB2312
Save and exit. Enter the following command on the terminal:
Sudo dpkg-reconfigure locales
Restart ubuntu.

After the restart, select Chinese in system Settings> language settings. The Chinese package is automatically downloaded. After the installation is complete, restart the package again.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.