<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[再谈mysql编码问题。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 05 Aug 2008 07:17:49 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	在前台页面里面，从数据库中选择出来的数据表中文项目，有的是正确的编码显示，有的是错误的乱码，分析后知道，原因可能有3种：<br/><br/>1. mysql_server 的语言环境应该为zh_CN.GBK ，同时数据库的环境变量中要把各个数据库中的字符集设定为utf8;<br/><br/>2. 页面前台输出需要转码<br/><br/>3. 运行客户端的时候，没有设定utf8编码就把数据库表建立，使得数据库表中本身插入的就是乱码<br/><br/>我遇到的起初认为是1；最后发现是3<br/><br/>错误的原因：<br/><br/>正确的解决方法：<br/><br/>解决utf8字符集的问题<br/><br/>mysql -h127.0.0.1 -P3336 -uroot < initTables.sql<br/>mysql -h127.0.0.1 -P3336 -uroot < initMacro.sql<br/>mysql -h127.0.0.1 -P3336 -uroot < initUsers.sql<br/>mysql -h127.0.0.1 -P3336 -uroot < initRoles.sql<br/>mysql -h127.0.0.1 -P3336 -uroot<br/><br/>这样插入的表，本身就是乱码，显示到前台，当然也是乱码了<br/><br/>解决utf8字符集的问题<br/>[aimm@aixuning MySQL]$ mysql --default-character-set=utf8 -h127.0.0.1 -P3336 -uroot < initTables.sql<br/>[aimm@aixuning MySQL]$ mysql --default-character-set=utf8 -h127.0.0.1 -P3336 -uroot < initMacro.sql<br/>[aimm@aixuning MySQL]$ mysql --default-character-set=utf8 -h127.0.0.1 -P3336 -uroot < initUsers.sql<br/>[aimm@aixuning MySQL]$ mysql --default-character-set=utf8 -h127.0.0.1 -P3336 -uroot < initRoles.sql<br/>[aimm@aixuning MySQL]$ mysql --default-character-set=utf8 -h127.0.0.1 -P3336 -uroot<br/><br/>首先应该在建表的时候指定该表是utf-8结构的，然后再进行设置char类型的。<br/>当然你设定为binary的数据格式，不设置utf-8表结构也可以，但是在firefox会出现？？？你得用php的trim("")去掉？？？!!mysql5.X
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 再谈mysql编码问题。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>