Get the App
SLTechnology News&Howtos  ›  Development  › 

How to view and set character sets by Linux

Shulou Source: shulou.com Published: 2022-06-01 21:20:36 09月10日 Update

Linux how to view and set the character set, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

First, the character set is reflected in the form of an environment variable in the system. There are several ways in which the current terminal uses the character set:

one

[root@ Testa``-``www tmp] ``# echo $Lang`zh _ CN.UTF``-``82

[root@ Testa``-``www ~] ``# env | grep LANG`` = ``zh _ CN.UTF``-``83

[root@ Testa``-``www ~] ``# export | grep Lange ```- ``x LANG`` = ``"zh_CN.UTF-8 "4

[root@ Testa``-``www ~] ``locale`LANG`` = ``zh _ CN.UTF``-`8``LC _ CTYPE`` = ```"zh_CN.UTF-8 "```LC_ NUMERIC`` =```" zh_CN.UTF-8" ``LC_ TIME`` = ```"zh_CN.UTF-8 "```LC_ COLATE`` = ``"zh_CN.UTF-8" ```zh_CN.UTF-8 "``LC_ MESSAGE`S` =``" zh_CN.UTF-8" ``LC_ PAPER`` = ``"zh_CN.UTF-8 "``LC_ NAME`` =``" zh_CN.UTF-8" ``LC_ ADDRESS`` = ``"zh_CN. UTF-8 "``LC_ TELEPHONE`` = ``"zh_CN.UTF-8" ```LC_ MEASUREMENT`` =``" zh_CN.UTF-8 "```LC_ identity ``= ``"zh_CN.UTF-8" ```LC_ ALL`` = display details

2. Note how to modify the character set:

If the default language is en_US.UTF-8, Chinese cannot be displayed and input in Linux's character and graphical interface.

If the default language is Chinese, such as zh_CN.GB18030 or zh_CN.gb2312, the character interface cannot be displayed and input, and the graphical interface can.

There are two ways to modify it:

1. Modify the way to set variables temporarily.

Export LANG`` = ``zh _ CN.UTF``-``82. Modify the file method, which is controlled by modifying / etc/sysconfig/i18n file

[root@ Testa``-``www ~] `# vim / etc/sysconfig/ i18n` * * `LANG`` = ``"zh_CN.UTF-8 "`* *` [root@ Testa``-``www ~] ``# source / etc/sysconfig/i18n complement: you can see Chinese on xshell: select Chinese when the system is installed, and automatically display Chinese after xshell connection, and the character set is: LANG`` =``" zh_CN.UTF-8 "

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Characters character sets methods Chinese interfaces variables graphics files systems languages help input clarity information content this form articles novices more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Microsoft MariaDB Shulou Information Shulou Technology