Run the following command to check the character set of the system:
Echo $ Lang $ Language
Oh, the character set of the original system is zh_CN.UTF-8. Return back to the step where the character set was selected, select the translation on the left of the Configuration window, and select UTF-8 from the sorted ed data assumed to be in which character set drop-down list on the right"
In this case, there will be no garbled characters in Chinese characters. Finally, the solution to Garbled text in Putty is as follows:
First look at the character set of the system, if it is UTF-8, it is simple, choose a good Chinese font, and then select the UTF-8 encoding on the line.
If the encoding is gb2312, GBK, or gb18030, and big5, the encoding cannot be seen in the putty encoding selection, select the last "Use font encoding ", in most cases, there is no problem, but I have not encountered any exceptions.
Now Linux if the default language to select Chinese, the default encoding is the UTF-8. When Redhat as 3 was previously installed, the language was set to Chinese. The default encoding is zh_cn.gb2312 and zh_cn.gb18030. It seems that it starts from as 3 Update 6, including the current as4 and As5, the default Chinese encoding has become zh_CN.UTF-8. As for Debian, Ubuntu and so on above, it seems that it has always been a UTF-8.
So the use of UTF-8, or use gb2312, GBK or gb18030? I personally prefer UTF-8. After all, most of the software we use is abroad, and there are more or less problems with Chinese encoding. Putty is no exception.
In addition, even if the language we select when installing Linux is Chinese. However, when we use putty for remote management, the Chinese folders we see will still be displayed in garbled characters. The following methods can help us solve the problem:
1. garbled console Terminal
Add the following content to the last line of the/etc/profile file:
Export lc_all = "zh_cn.gb18030"
2. garbled XWindow Terminal
Add the following content to the last line of the/etc/sysconfig/i18n file:
Export lc_all = "zh_cn.gb18030"
In fact, Putty garbled characters are nothing more than encoding and character sets. I can use the above steps in RHEL4, 5, and centos5.2; if not, I simply give up putty, switch to X-shell of xmanager3 Enterprise Edition. X-shell is currently the first choice for Linux O & M personnel. To solve this problem, only step 2 is required. In particular, it is quite convenient to copy and paste the code.