Display Chinese characters on linux terminal and shell

Source: Internet
Author: User
Tags i18n
Display Chinese Characters in linux terminal and shell-Linux general technology-Linux technology and application information. The following is a detailed description. After testing, it seems that the method works, but none of the others works. It may be because the system is different or other reasons.

Method 1:

Modify the/etc/sysconfig/i18n File

Change LANG = "en_US" to GB2312.

You do not need to restart the machine.

# LANG = "GB2312"

Then you can.

The i18n modification is only valid for restart.

The method that takes effect immediately is the one I wrote.

Method 2:

# Vi ~ /. Bash_profile

LANG = zh_CN.GB18030

LANGUAGE = zh_CN.GB18030: zh_CN.GB2312: zh_CN

Export LANG LANGUAGE

In this way, you can enter and display Chinese characters on the terminal, and the original Chinese characters in the shell script also solve the garbled problem.

Method 3:

Modify/etc/sysconfig/i18n

LANG = "zh_CN.UTF-8" to LANG = "zh_CN.GB18030"

From RedHatLinux server configuration and application
Related Article

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.