Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to view and set character sets by Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report