Locale of the Debian system

Source: Internet
Author: User
The locale of the Debian system-the technology of the Linux release-Debian information. The following is a detailed description. I have been confused about linux locale for a long time. The kde installed last night has some problems in Chinese. Take this opportunity to thoroughly understand the locale settings.

The naming rule for locale is <语言> _ <地区> . <字符集编码> , Such as zh_CN.UTF-8, zh represents Chinese, CN represents mainland China, UTF-8 represents character set.

"C" is the default locale, and "POSIX" is the alias of "C. So when we install a new system, the default locale is C or POSIX.

Debian does not compile all available locales in the system. Check/usr/lib/locale to determine which locales (except the default "C") has been compiled and installed on the system.

To install locales in Debian, follow these steps:
Use the apt-get install locales command to install the locales package

After the locales package is installed, the system automatically configures locale. You only need to select the desired locale. Specify the default locale. In this way, the system will automatically generate the corresponding locale and configure the system locale.

Adding a new locale is also easy. Use dpkp-reconfigure locales to reconfigure locale.

You can also manually add locale to add the new locale to the/etc/locale. gen file, and then run the locale-gen command to generate a new locale. You can set the locale of the system by setting the LC _ * variable described above. The following is an example of a locale. gen file.

# This file lists locales that you wish to have built. You can find a list
# Of valid supported locales at/usr/share/i18n/SUPPORTED. Other
# Combinations are possible, but may not be well tested. If you change
# This file, you need to rerun locale-gen.
#

Zh_CN.GBK GBK

Zh_CN.UTF-8 UTF-8

In Shell, the system prompts Chinese characters and supports Chinese characters. The encoding configurations of LANG and shell must be consistent, and locale is installed in Chinese. For example, both LANG and shell are encoded as zh_CN.utf8, And the locale zh_CN.utf8 is installed. If the shell and LANG configurations are different, garbled characters are displayed in Chinese. If the locale set in LANG is not installed, the Chinese prompt information of the system cannot be displayed, but only the English prompt information is displayed.
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.