<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[刘新修]]></title> 
<link>http://pic1.liuxinxiu.com:80/index.php</link> 
<description><![CDATA[刘新修的个人博客 (Liuxinxiu'S Blog)]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[刘新修]]></copyright>
<item>
<link>http://pic1.liuxinxiu.com:80/ssh_garbled/</link>
<title><![CDATA[Linux （CentOS ）客户端putty下SSH乱码解决]]></title> 
<author>刘新修 &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux/Unix]]></category>
<pubDate>Fri, 24 Dec 2010 06:53:58 +0000</pubDate> 
<guid>http://pic1.liuxinxiu.com:80/ssh_garbled/</guid> 
<description>
<![CDATA[ 
	<p><strong><span style="color: #0000ff">CentOS 客户端putty下SSH乱码解决：</span></strong></p><p><span style="background-color: #ff0000"><span style="color: #ffffff"><strong><span>系统环境：CentOS-5.4 中文版本</span></strong></span></span></p><p><strong><span style="color: #003366">网上搜索的Linux中的SSH终端乱码问题的解决方案：</span></strong></p><p><strong><span style="color: #003366">vi /etc/sysconfig/i18n</span></strong></p><p>直接有效的方面，中文语音/文件UTF-8编码的（香港新世界机房）</p><div class="codeText"><div class="codeHead">C#代码</div><ol start="1" class="dp-c"><li class="alt"><span><span>export&nbsp;LANG=</span><span class="string">&quot;zh_CN.UTF-8&quot;</span><span>&nbsp;&nbsp;</span></span></li><li><span>export&nbsp;LANGUAGE=<span class="string">&quot;zh_CN.UTF-8&quot;</span><span>&nbsp;&nbsp;</span></span></li></ol></div><p><span style="color: #003366">LANG=&quot;zh_CN.GB18030&quot;<br />LANGUAGE=&quot;zh_CN.GB18030:zh_CN.GB2312:zh_CN&quot;<br />SUPPORTED=&quot;zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en&quot;<br />SYSFONT=&quot;lat0-sun16&quot;</span></p><p><span style="color: #003366">这样中文在SSH,telnet终端就可以正常显示了。</span></p><p><span style="color: #003366">按照以上所述修改配置文件：</span></p><p><span style="color: #003366"><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030.gif"><img height="222" alt="" width="570" src="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030.gif" /></a></span></p><p><span style="color: #ffffff"><span style="background-color: #0000ff"><strong><span>于是安装以下的步骤进行更改，之后重启动时进程加载名称显示乱码：</span></strong></span></span></p><p><span style="color: #003366"><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030-ui-1.gif"><img height="424" alt="" width="608" src="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030-ui-1.gif" /></a></span></p><p><span style="color: #003366"><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030-ui-2.gif"><img height="586" alt="" width="722" src="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030-ui-2.gif" /></a></span></p><p><span style="color: #003366">进入系统后使用VIM 打开HTML 显示也是乱码：</span></p><p><span style="color: #003366"><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030-c-1.gif"><img height="148" alt="" width="257" src="http://at.liuxinxiu.com/2010/12/image/zh_CN_GB18030-c-1.gif" /></a></span></p><p><span style="color: #003366">2.安装Linux的时候选择的是中文字,但是使用的时候出现了乱码解决方法是在命令提示下输入export LANG=C</span></p><p><span style="color: #003366">3.export LC_ALL=zh_CN.GBK<br />export LANG=zh_CN.GBK </span></p><p><span style="background-color: #0000ff"><span style="color: #ffffff"><strong><span>第二和第三在每次使用SSH客户终端时都必须执行这样的命令比较麻烦。。</span></strong></span></span></p><p><strong><span style="background-color: #ff0000"><span style="color: #ffffff"> 以下是完美解决方案：</span></span></strong></p><p><span style="color: #ff0000"><strong>默认为utf8，如出现乱码可设置为GBK 如图：</strong></span><br /><strong>手动更改配置文件的命令：</strong></p><p><strong>================================<br /></strong>shell&gt; <strong><span style="color: #ff0000">vi /etc/sysconfig/i18n</span></strong><br />将LANG=&rdquo;zh_CN.UTF-8&Prime;修改为：<br />LANG=&rdquo;zh_CN.GBK&rdquo;<br />保存并关闭，运行下面的命令使配置生效：<br />shell&gt; source /etc/sysconfig/i18n</p><p>===================================</p><p>修改为如下：</p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/zh_CN_GBK.gif"><img height="147" alt="" width="285" src="http://at.liuxinxiu.com/2010/12/image/zh_CN_GBK.gif" /></a></p><p>重启系统后：</p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/GBK-c-1.gif"><img height="82" alt="" width="402" src="http://at.liuxinxiu.com/2010/12/image/GBK-c-1.gif" /></a></p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/GBK-c-2.gif"><img height="151" alt="" width="281" src="http://at.liuxinxiu.com/2010/12/image/GBK-c-2.gif" /></a></p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/GBK-c-3.gif"><img height="92" alt="" width="204" src="http://at.liuxinxiu.com/2010/12/image/GBK-c-3.gif" /></a></p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/12/image/GBK-c-4.gif"><img height="106" alt="" width="254" src="http://at.liuxinxiu.com/2010/12/image/GBK-c-4.gif" /></a></p>
]]>
</description>
</item><item>
<link>http://pic1.liuxinxiu.com:80/ssh_garbled/#blogcomment</link>
<title><![CDATA[[评论] Linux （CentOS ）客户端putty下SSH乱码解决]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://pic1.liuxinxiu.com:80/ssh_garbled/#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>