[Linux] Modify system default encoding

Source: Internet
Author: User
Tags locale naming convention

Locale command

The locale command is used to set the locale in which the program runs.

Locale sets the naming convention for the locale to Language_area.charset, such as En_us.utf8, which represents the English language, the region is the United States, and the character set is UTF-8.

View current character mapping file

$ locale Charmap
UTF-8

To view available common language environments

$ locale-acc.utf-8En_ag ...

Viewing available character mapping files

$ locale-acc.utf-8en_ag ...

Set the default encoding

Edit ~/.BASHRC, set the default encoding to UTF-8:

Export lc_all=en_us.utf8export LANG= $LC _all

The environment variable LANG is the default value for lc_* and is used if no lc_* is set.

Lc_all is a macro that overrides all lc_* values except LANG if the value is set.

[Linux] Modify system default encoding

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.