In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail about Linux terminal Chinese display garbled solution, the quality of the article content is high, so Xiaobian share for everyone to make a reference, I hope you read this article after a certain understanding of related knowledge.
We know that our operating system does not matter whether it is Chinese version or English version. Whether it is windows or Linux, the whole world is the same kernel when the system is released. Whether the system presents us with English or Chinese depends entirely on the language package you choose. People from different countries choose their own language packs when installing and using them. The language in the application is not written dead. It calls the relevant language according to the system settings. Therefore, an application program can be written without modification. Users from different countries around the world can use it in their native language interface. This is the so-called internationalization (internationalization), referred to as i18n. This is also the future of software development.
So, if I install different language packs and fonts on my system, how does the system determine which language interface I want and invoke the relevant fonts? What files and variables in the system control this?
You can use the locale command to view the character set that the current system defaults to.
# locale
Under RedHat/CentOS, the file that records the default language used by the system is/etc/sysconfig/i18n. If the default installed system is Chinese, the contents of i18n are as follows:
LANG="zh_CN.UTF-8" SYSFONT="latarcyrheb-sun16" SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
Among them, the LANG variable is the abbreviation of language. Users with a slight English background can see at a glance that this variable determines the default language of the system, that is, the menu of the system, the toolbar language of the program, the default language of the input method, etc. SYSFONT is short for system font, which determines which font is used by default. The SUPPORTED variable determines which languages the system supports, that is, which languages the system can display. It should be noted that since computers originated in English-speaking countries, no matter what you set these variables to, English is always supported by default, and no matter what font is used, English fonts are always included.
So how to display Chinese?
1. The system must be installed with Chinese language pack
# yum -y groupinstall chinese-support
2, just have language pack is not enough, we have to set the corresponding character set
##Provisional entry into force # export LANG="zh_CN. UTF-8" #Set to Chinese # export LANG="en_US. UTF-8" #Set it to English, I prefer this export ##Permanently take effect, edit/etc/sysconfig/i18n (preferably reboot) LANG="zh_CN. UTF-8" ##Or edit/etc/profile and add the following line export LANG="zh_CN. UTF-8"#Reload # . /etc/profile ##View current character set # echo $LANG
OK, after the above settings, Chinese should be displayed on the terminal.
3, SSH remote terminal garbled code
If SSH terminal is still garbled, then we also need to set the terminal software code.
Xshell:
SecureCRT:
4. What if the terminal is still Chinese garbled?
Set SSH software and select a font that supports Chinese.
Linux Windows need to modify files between each other, and then garbled.
Copy up often found Chinese display garbled code. The reason is that the default file format in Windows is GBK(gb2312), while Linux is generally UTF-8. The more cumbersome method is to convert the content into utf-8 encoding format under windows, but it is quite troublesome, and encounter a file to turn back. Here's how to solve this problem once and for all in Linux, see the encoding of the file and how to transcode the file.
To avoid these problems, the best way is to unify the code. For text files, they are uniformly saved in UTF8 format. Do not use word, notepad under windows. Sublime text, or notepad++ are recommended.
About Linux terminal Chinese display garbled solution to share here, hope the above content can have some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.