Linux Terminal display garbled solution __linux

Source: Internet
Author: User
Tags i18n locale ssh ssh secure shell
It programmer development must-all kinds of resources download list, the most complete IT resources in history, personal collection summary.


Putty Chinese Garbled Solution method
Method One: Open Putty Main program, select Window-〉appearance-〉fontsettings-〉change ..., select Fixedsys font, character set select chinese_gb2312. In the window-〉appearance-〉translation, Received data assumed to is in which character set, change the use font encoding to UTF-8 if used frequently, Save these settings in session. Now open putty, login successful, enter in the shell: Export lc_all= ' Zh_cn.utf8 ' method two: Edit/etc/sysconfig/i18n will be the 1th sentence "lang=" zh_cn . UTF-8 "" Changed to "lang=" ZH_CN. GB18030 "", when you're done, you'll be able to log in again to display normal
1, console terminal garbled
Add the following on the last line of the/etc/profile file:
Export Lc_all= "ZH_CN. GB18030 "
2, Xwindow terminal garbled
Add the following on the last line of the/etc/sysconfig/i18n file:
Export Lc_all= "ZH_CN. GB18030 "+
**************************
Garbled characters are divided into two kinds of situations:
1. Terminal (pure Shell interface) of garbled
Vi/etc/profile
Exportlc_all= "ZH_CN. Gb18030:zh_cn. Gb2312:zh_cn. GBK:zh_CN:en_US. Utf-8:en_us:en:zh:zh_tw:zh_cn. BIG5 "
Save exit, reboot system can ...
2.x-window (graphical interface) of garbled
vi/etc/sysconfig/i18n
Lang= "ZH_CN. Gb18030:zh_cn. Gb2312:zh_cn. GBK:zh_CN:en_US. Utf-8:en_us:en:zh:zh_tw:zh_cn. BIG5 "
Language= "ZH_CN. Gb18030:zh_cn. Gb2312:zh_cn. GBK:zh_CN:en_US. Utf-8:en_us:en:zh:zh_tw:zh_cn. BIG5 "
Save reboot ...
*********************
New Linux virtual machine, with Vim appeared in Chinese garbled problem, find the data, the solution is as follows:
vi/etc/sysconfig/i18n
Change the content to
Lang= "ZH_CN. GB18030 "
Language= "Zh_CN.GB18030:zh_CN.GB2312:zh_CN"
Supported= "ZH_CN. GB18030:zh_CN:zh:en_US. Utf-8:en_us:en "
Sysfont= "Lat0-sun16"
So the Chinese in the Ssh,telnet terminal will be able to display the normal
Among them, the main modification content mainly is ZH_CN. GB18030, which should pay attention to the content of VI personality under the root directory, to pay attention to permissions
**************************
After each install Linux, with SSH connection, Chinese always display garbled. 51Testing Software Test Network
Workaround: Edit/etc/sysconfig/i18n, lang= "ZH_CN." UTF-8 "changed to Lang=" ZH_CN. GB2312 ".
&m^%k7x6x7iq051testing software Test Network K! w|,r8cv&r5n
Disconnect the reconnection.
****************************
Solution of Chinese garbled problem in Linux (2008-06-07-12:55:45)
From Windows passed files copied to Linux is garbled, we want to display in Linux under the Chinese, how to do? We first Test, the Linux under the Chinese can be normal display? A: Yes. So the problem is more obvious, windows under the cuff can not be displayed, Shows that the formats supported under Windows and Linux are not the same.
Linux is generally used utf-8 encoding, and we edit the file on Windows is gb2312 encoding. So the Chinese code will be garbled. To correct this problem is actually very simple. Just convert the file to UTF-8 encoding and then import it OK.
Then use the following command to convert:
Iconv-f gb2312-t Utf-8 test.txt>testutf8.tzt
(-F is source code,-t convert target encoding, test.txt source file, Testutf8.txt generate target encoding file)
Note: Use Iconv-l to view the System support encoding format. Of course, you can add the encoding format:
Default is UTF8, if you want to use another encoding such as GBK
To manually change a configuration file's command:
Shell> vi/etc/sysconfig/i18n
Will lang= "ZH_CN." UTF-8 "modified to:
Lang= "ZH_CN. GBK "
Save and close, and run the following command to make the configuration effective:
Shell> source/etc/sysconfig/i18n
To display the terminal character encoding as Simplified Chinese:
Shell> vi/etc/profile.d/chinese.sh
Add the following line: Export LC_ALL=ZH_CN. GBK
Shell> source/etc/profile.d/chinese.sh
*******************************
Solve Java's Chinese garbled problem under Linux operating system
After jdk15, just build a fallback directory under ~/jre/lib/fonts/and grill the fonts you want to use in Java into this directory
The following method tests the pass under FC6, assuming that the user's JRE path is/usr/java/jdk1.6.0_03/jre/
Cd/usr/java/jdk1.6.0_03/jre/lib/fonts
sudo mkdir fallback
Copy C:\WINDOWS\FONTS\SIMSUN.TTC to/usr/java/jdk1.6.0_03/jre/lib/fonts/ After the centos5.2 configuration is completed in the fallback folder, the normal ability to display Chinese, after viewing the discovery support Utf-8 character set.
While putty and SSH Secure Shell connection is found garbled, mainly performance for the implementation of VIM garbled, su command garbled.
Viewed using the $locale command, the following appears:
Lang=zh_cn. UTF-8
Language=zh_cn:zh
Lc_ctype= "ZH_CN. UTF-8 "
Lc_numeric= "ZH_CN. UTF-8 "
Lc_time= "ZH_CN. UTF-8 "
Lc_collate= "ZH_CN. UTF-8 "
Lc_monetary= "ZH_CN. UTF-8 "
Lc_messages= "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_identification= "ZH_CN. UTF-8 "
Lc_all=
Solution:
1. For the putty0.6 version
A. Modify the CentOS/ect/sysconfig/i18n content is:
Lang= "ZH_CN. UTF-8 "
B. Modify the Putty Configuration window windows->appearance->fontsetting for the new song body, number 10th words.
Modify the receive data assumed to is in which characterset for translation:
UTF-8. (because there is no Chinese character set, GB2312 or cp936) in the down list.
After this modification is complete, putty will normally support the Chinese display.
2. For SSH Secure Shell version.
A. Change the configuration font to Arial, but still garbled,
B. The/ect/sysconfig/i18n content of the modified CentOS is:
Lang= "ZH_CN. GB18030 "
Language= "Zh_CN.GB18030:zh_CN.GB2312:zh_CN"
Supported= "ZH_CN. GB18030:zh_CN:zh:en_US. Utf-8:en_us:en "
Sysfont= "Latarcyrheb-sun16"
---The above content is found on the internet, according to write.
Discovery connection SSH Secure Shell can display Chinese correctly.
With $locale view, the configuration seen above becomes GB18030 encoded.
* * But again with Putty connection, but became garbled, I understand because Putty still use is UTF8 code,
and configure SSH Secure Shell, will CentOS changed to GB18030 code, so garbled.
C. To the server, restart the CentOS, found that the display of Chinese is also normal.
3. If you find a problem with the SSH Secureshell or cause problems, reconfigure putty use,
Configuration scenarios can refer to the above configuration.
Conclusion:
Because the SSH Secureshell window conforms to the Windows display, it is temporarily set to use the SSH Secure Shell client.
And it also binds the FTP upload function, relatively convenient.
Change: Consider the establishment of MySQL and so many places using Utf-8 encoding, all still use Putty client, system code changed to Utf-8
##############################################################
Phenomenon: Use SSH software to connect, Chinese is garbled: Modify/etc/sysconfig/i18n file, change it to the following content: lang= "ZH_CN." GB18030 "Language=" ZH_CN. Gb18030:zh_cn. GB2312:ZH_CN "supported=" ZH_CN. Utf-8:zh_cn:zh:en_us. Utf-8:en_us:en "sysfont=" "Latarcyrheb-sun16" #source/etc/sysconfig/i18n Restart the machine, the problem should be solved. CentOS change lang= "ZH_CN. GB18030 "supported=" ZH_CN. GB18030:zh_CN:zh:en_US. Utf-8:en_us:en "sysfont=" Lat0-sun16 "############################################################# #修改/etc/ Profile Add EXPORTLC_ALL=ZH_CN # for LINUX:ZH_CN EXPORTLANG=ZH_CN # for LINUX:ZH_CN can be resolved

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.