<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DBAlife &#187; 字符集</title>
	<atom:link href="http://www.dbalife.com/archives/tag/%e5%ad%97%e7%ac%a6%e9%9b%86/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbalife.com</link>
	<description>网站系统架构实践</description>
	<lastBuildDate>Wed, 27 Jul 2011 09:57:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WEB应用在linux下乱码的解决一例</title>
		<link>http://www.dbalife.com/archives/120.html</link>
		<comments>http://www.dbalife.com/archives/120.html#comments</comments>
		<pubDate>Tue, 13 May 2008 07:57:10 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[操作系统]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[乱码]]></category>
		<category><![CDATA[字符集]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=120</guid>
		<description><![CDATA[今天将一个Windows平台下的J2EE项目移植到Redhat Enterprise Linux 4中，由CMS程序生成的首页却出现了乱码。 这个页面中标记了 &#60;meta http-equiv="Content-Type" content="text/html; charset=gb2312" /&#62; 而在浏览器中，gb2312编码显示为乱码，手动切换到utf－8则显示正常。 导致这一错误的原因在于Redhat默认的字符集为zh_CN.UTF-8， 解决的方法有2种： 1、 修改页面的字符集 2、修改操作系统的字符集 这里我选择修改系统字符集，有3种方式： 全用户永久生效： 修改/etc/sysconfig/i18n 单用户永久生效： cp /etc/sysconfig/i18n $HOME/.i18n 修改 $HOME/.i18n 文件 临时生效： export LANG=zh_CN.GB2312 export LC_ALL=zh_CN.GB2312 PS. 如果系统字符集是WEB应用的超集，也是可以的。 例如系统字符集为zh_CN.GB18030，GB2312就可以无障碍正常显示。 Related posts: RHAS4安装fcitx3.0输入法 中文编码基础知识
Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/53.html' rel='bookmark' title='RHAS4安装fcitx3.0输入法'>RHAS4安装fcitx3.0输入法</a></li>
<li><a href='http://www.dbalife.com/archives/12.html' rel='bookmark' title='中文编码基础知识'>中文编码基础知识</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>今天将一个Windows平台下的J2EE项目移植到Redhat Enterprise Linux 4中，由CMS程序生成的首页却出现了乱码。</p>
<p>这个页面中标记了</p>
<blockquote><p>&lt;meta http-equiv="Content-Type" content="text/html; <span style="color: #ff0000;">charset=gb2312</span>" /&gt;</p></blockquote>
<p>而在浏览器中，gb2312编码显示为乱码，手动切换到utf－8则显示正常。</p>
<p>导致这一错误的原因在于Redhat默认的字符集为<span style="color: #ff0000;">zh_CN.UTF-8</span>，</p>
<p>解决的方法有2种：</p>
<blockquote><p>1、 修改页面的字符集</p>
<p>2、修改操作系统的字符集</p></blockquote>
<p>这里我选择修改系统字符集，有3种方式：</p>
<blockquote><p><strong>全用户永久生效</strong>：<br />
修改/etc/sysconfig/i18n</p>
<p><strong>单用户永久生效</strong>：<br />
<span style="font-size: x-small;">cp /etc/sysconfig/i18n $HOME/.i18n<br />
修改 $HOME/.i18n 文件</span></p>
<p><strong>临时生效</strong>：<br />
<span style="font-size: x-small;">export LANG=zh_CN.GB2312<br />
export LC_ALL=zh_CN.GB2312 </span></p></blockquote>
<p>PS. 如果系统字符集是WEB应用的超集，也是可以的。<br />
例如系统字符集为zh_CN.GB18030，GB2312就可以无障碍正常显示。</p>
<p>Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/53.html' rel='bookmark' title='RHAS4安装fcitx3.0输入法'>RHAS4安装fcitx3.0输入法</a></li>
<li><a href='http://www.dbalife.com/archives/12.html' rel='bookmark' title='中文编码基础知识'>中文编码基础知识</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/120.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

