<?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>Dominic.Xu&#039;s 博客 &#187; 中文</title>
	<atom:link href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87/feed" rel="self" type="application/rss+xml" />
	<link>http://xuplus.com</link>
	<description>Web 2.0 生活</description>
	<lastBuildDate>Wed, 24 Aug 2011 05:26:12 +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>XOOPS的Page模组UTF-8字符编码下的使用方法</title>
		<link>http://xuplus.com/article/2007/06/a38.html</link>
		<comments>http://xuplus.com/article/2007/06/a38.html#comments</comments>
		<pubDate>Mon, 25 Jun 2007 07:06:14 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[Page]]></category>
		<category><![CDATA[UTF 8]]></category>
		<category><![CDATA[xajax]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=38</guid>
		<description><![CDATA[文明猪汉化了非常好用的Page模组，其功能强大得过了头，充分体现了数据展现分离思想，将Xoops中原本主题、布局、区块的概念扩充到主题、布局、区块、皮肤，将原来相对固定的布局方式更改为随意布局的形式（如果可以直接拖动就更完美了），将然来局限于系统提供的区块提升到可以随意创建区块和随意利用区块的高度，但是目前Page模组仅仅只能使用GB2312编码上，如果网站采用UTF-8编码这不能利用这个Page模组。之前就找到了解决的办法，这次乘解决xajax中文显示的问题一并写出来吧。 其实这个bug是由xajax库引起的（参见我另外一篇文章：PHP中xajax库中文问题及提示返回XML文件无效的解决办法 ），解决办法是： 将page目录下所有文件全部采用UTF-8无BOM格式保存（当然语言文件不必要），至少server/page.server.php这个文件需要采用UTF-8无BOM格式保存（UltraEdit 操作方法：F12或另存为界面中格式下拉框选择‘UTF-8－无 BOM’），index.php这个也需要UTF-8无BOM格式保存，另外建立对应的UTF-8编码的语言文件。再将Framework目录下xajax目录下所有的php文件全部使用UTF-8无BOM格式保存。一般即可。 之前的一个项目中使用了UTF-8格式的Page模组，这个模组的UTF-8格式支持包还是让文明猪来发布吧，不过有需要的也可以联系我。   标签： Page, PHP, UTF 8, xajax, XOOPS, 中文]]></description>
			<content:encoded><![CDATA[<p><font size="3">文明猪汉化了非常好用的Page模组，其功能强大得过了头，充分体现了数据展现分离思想，将Xoops中原本主题、布局、区块的概念扩充到主题、布局、区块、皮肤，将原来相对固定的布局方式更改为随意布局的形式（如果可以直接拖动就更完美了），将然来局限于系统提供的区块提升到可以随意创建区块和随意利用区块的高度，但是目前Page模组仅仅只能使用GB2312编码上，如果网站采用UTF-8编码这不能利用这个Page模组。之前就找到了解决的办法，这次乘解决xajax中文显示的问题一并写出来吧。</font></p>
<p><font size="3">其实这个bug是由xajax库引起的（参见我另外一篇文章：<a href="http://xuplus.com/article/2007/06/a35.html">PHP中xajax库中文问题及提示返回XML文件无效的解决办法 </a>），解决办法是：</font></p>
<p><font size="3">将page目录下所有文件全部采用UTF-8无BOM格式保存（当然语言文件不必要），至少server/<a href="http://xuplus.com/article/tag/page" class="st_tag internal_tag" rel="tag" title="标签 Page 下的日志">page</a>.server.php这个文件需要采用UTF-8无BOM格式保存（UltraEdit 操作方法：F12或另存为界面中格式下拉框选择‘UTF-8－无 BOM’），index.php这个也需要UTF-8无BOM格式保存，另外建立对应的UTF-8编码的语言文件。再将Framework目录下xajax目录下所有的php文件全部使用UTF-8无BOM格式保存。一般即可。</font></p>
<p><font size="3">之前的一个项目中使用了UTF-8格式的Page模组，这个模组的UTF-8格式支持包还是让文明猪来发布吧，不过有需要的也可以联系我。</font></p>
<p> </p>

	标签： <a href="http://xuplus.com/article/tag/page" title="Page" rel="tag">Page</a>, <a href="http://xuplus.com/article/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://xuplus.com/article/tag/utf-8" title="UTF 8" rel="tag">UTF 8</a>, <a href="http://xuplus.com/article/tag/xajax" title="xajax" rel="tag">xajax</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87" title="中文" rel="tag">中文</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/06/a38.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP中xajax库中文问题及提示返回XML文件无效的解决办法</title>
		<link>http://xuplus.com/article/2007/06/a37.html</link>
		<comments>http://xuplus.com/article/2007/06/a37.html#comments</comments>
		<pubDate>Mon, 25 Jun 2007 06:31:26 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[xajax]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[编码]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=37</guid>
		<description><![CDATA[xajax是PHP下一个非常好的ajax框架，虽然xajax自己说自己是一个库(Library)，但是我觉得它更像一个框架（Framework）。xajax是一个开源的 PHP 类库 它能够让你黏合HTML、CSS、Javascript和PHP，并可以结合Smarty模板系统使用。 在运用Xoops的Page模组的时候，发现其不能和中文正常工作，特别是不能和UTF-8编码的页面一起工作，昨天在利用这个实现DataGrid的时候发现完全不能正常工作了，一直报“the XML response that was returned from the server is invalid”这个错误，Google了一下，发现不少人也有这个问题。结合之前解决Xoops的Page模组（感谢文明猪）的UTF-8使用问题的方法，终于发现了完美解决xajax库使用中文的方法。 如果页面采用GB2312或GBK作为编码或字符集，一般网络上面提到的方法可以解决：需要注意的是common.php、server.php及server.php用到的php文件（特别是生成数据的文件）全部不要使用UTF-8编码格式保存而使用ASCII格式保存。同时server.php输出的数据内容最好也采用gb2312编码。 在common.php前面定义 define(&#8216;XAJAX_DEFAULT_CHAR_ENCODING&#8217;,'GB2312&#8242;); 再在调用时使用： $xajax = new xajax(); $xajax-&#62;decodeUTF8InputOn(); 或者 $xajax = new xajax(&#8216;gb2312&#8242;); $xajax-&#62;setCharEncoding(); $xajax-&#62;decodeUTF8InputOn(); $objResponse = new xajaxResponse(&#8216;gb2312&#8242;); 如果页面采用UTF-8字符集的话，网上一些人说使用UTF-8格式编码就可以了，实际上即使全部使用UTF-8编码也不能正常工作，还是会报错：“the XML response that was returned from the server is invalid”。联想到之前在IE下碰到UTF-8 BOM Bug（文章：IE下页面无端端空出一行及utf8页面无法显示的解决方法 ），会不会这个地方服务器传回的XML文件中也包含多个UTF-8 BOM内容呢？通过ethereal截获数据包发现，服务器返回的内容中还真是包含了多个UTF-8 BOM，可能还是IE使用的Microsoft XML Parser的UTF-8 BOM Bug吧。这样解决办法就出来了：所有页面全部采用UTF8编码并使用无UTF-8 [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small;">xajax是PHP下一个非常好的ajax框架，虽然xajax自己说自己是一个库(Library)，但是我觉得它更像一个框架（Framework）。xajax是一个开源的 <a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a> 类库 它能够让你黏合HTML、CSS、Javascript和PHP，并可以结合Smarty模板系统使用。</span></p>
<p><span style="font-size: small;">在运用Xoops的Page模组的时候，发现其不能和中文正常工作，特别是不能和UTF-8编码的页面一起工作，昨天在利用这个实现DataGrid的时候发现完全不能正常工作了，一直报“the XML response that was returned from the server is invalid”这个错误，Google了一下，发现不少人也有这个问题。结合之前解决Xoops的Page模组（感谢文明猪）的UTF-8使用问题的方法，终于发现了完美解决xajax库使用中文的方法。</span></p>
<p><span style="font-size: small;">如果页面采用GB2312或GBK作为编码或字符集，一般网络上面提到的方法可以解决：需要注意的是common.php、server.php及server.php用到的php文件（特别是生成数据的文件）全部不要使用UTF-8编码格式保存而使用ASCII格式保存。同时server.php输出的数据内容最好也采用gb2312<a href="http://xuplus.com/article/tag/%e7%bc%96%e7%a0%81" class="st_tag internal_tag" rel="tag" title="标签 编码 下的日志">编码</a>。<br />
在common.php前面定义<br />
define(&#8216;<a href="http://xuplus.com/article/tag/xajax" class="st_tag internal_tag" rel="tag" title="标签 xajax 下的日志">XAJAX</a>_DEFAULT_CHAR_ENCODING&#8217;,'GB2312&#8242;);<br />
再在调用时使用：<br />
$xajax = new xajax();<br />
$xajax-&gt;decodeUTF8InputOn();<br />
或者<br />
$xajax = new xajax(&#8216;gb2312&#8242;);<br />
$xajax-&gt;setCharEncoding();<br />
$xajax-&gt;decodeUTF8InputOn();<br />
$objResponse = new xajaxResponse(&#8216;gb2312&#8242;); </span></p>
<p><span style="font-size: small;">如果页面采用UTF-8字符集的话，网上一些人说使用UTF-8格式编码就可以了，实际上即使全部使用UTF-8编码也不能正常工作，还是会报错：“the XML response that was returned from the server is invalid”。联想到之前在IE下碰到UTF-8 BOM Bug（文章：<a href="http://xuplus.com/article/2007/04/a6.html">IE下页面无端端空出一行及utf8页面无法显示的解决方法 </a>），会不会这个地方服务器传回的XML文件中也包含多个UTF-8 BOM内容呢？通过ethereal截获数据包发现，服务器返回的内容中还真是包含了多个UTF-8 BOM，可能还是IE使用的Microsoft XML Parser的UTF-8 BOM Bug吧。这样解决办法就出来了：所有页面全部采用UTF8编码并使用无UTF-8 BOM保存（UltraEdit 操作方法：F12或另存为界面中格式下拉框选择‘UTF-8－无 BOM’），页面包括xajax库文件、common.php文件、server.php文件。供访问的页面也可以使用无UTF-8 BOM保存。</span></p>
<p><span style="font-size: small;">有时候返回的参数（特别是中文部分）被url编码了，这个时候需要我们将返回的数据使用Urldecode进行处理，以便能够正常完成后面的数据库操作。 </span></p>
<p><span style="font-size: small;">最新xajax 0.25下载地址：<a title="http://prdownloads.sourceforge.net/xajax/xajax_0.2.5.zip?download" href="http://prdownloads.sourceforge.net/xajax/xajax_0.2.5.zip?download">http://prdownloads.sourceforge.net/xajax/xajax_0.2.5.zip?download</a></span></p>
<p><span style="font-size: small;">xajax中文手册（HonestQiao第一版，FlyingHail修改版） <a href="http://www.flyinghail.net/?p=44">http://www.flyinghail.net/?p=44</a></span></p>
<p><span style="font-size: small;">UTF-8 BOM解释：”EF BB BF” 这三个字节就叫BOM，BOM的全称叫做”Byte Order Mard”。在UTF-8文件中常用BOM来表明这个文件是UTF-8文件，而BOM的本意实在UTF-16中用来表示高低字节序列的。</span></p>
<p><span style="font-size: small;">另外，PHP网站上说使用&#8211;enable-zend-multibyte可以解决这类问题，不过没有尝试，并且预计在PHP 6.0中会对Unicode做完美的支持。</span></p>

	标签： <a href="http://xuplus.com/article/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://xuplus.com/article/tag/xajax" title="xajax" rel="tag">xajax</a>, <a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87" title="中文" rel="tag">中文</a>, <a href="http://xuplus.com/article/tag/%e7%bc%96%e7%a0%81" title="编码" rel="tag">编码</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/06/a37.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Tag插件(UltimateTagWarrior) 不能使用中文tag的解决办法</title>
		<link>http://xuplus.com/article/2007/04/a16.html</link>
		<comments>http://xuplus.com/article/2007/04/a16.html#comments</comments>
		<pubDate>Wed, 18 Apr 2007 09:07:39 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[Web应用]]></category>
		<category><![CDATA[404错误]]></category>
		<category><![CDATA[tag插件]]></category>
		<category><![CDATA[UltimateTagWarrior]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=16</guid>
		<description><![CDATA[今天加入了UltimateTagWarrior模组加入Tag，但是只要Tag是中文的，启用rewrite之后，均不能正常显示，全部报404错误。经过长时间的跟踪终于发现问题了。以下以http://xuplus.com/tag/合肥 为例。 wp-includes下classes.php文件61行附近              $req_uri = str_replace($pathinfo, ”, $req_uri); 这行代码主要作用是将$reg_uri赋值/tag，但运行时 pathinfo为 合肥 req_url为/tag/%E5%90%88%E8%82%A5，这样并不能完成替换操作给$reg_uri赋值/tag。替换成              $req_uri = urldecode(str_replace(urlencode($pathinfo), ”, str_replace(&#8216;/&#8217;,'%2F&#8217;,$req_uri)));              //Modified By XuYong 修正url中有中文字符的问题$pathinfo被urldecode了,导致不能正常工作的问题 即可正常访问。 标签： 404错误, tag插件, UltimateTagWarrior, Wordpress, 中文]]></description>
			<content:encoded><![CDATA[<p><font size="3">今天加入了UltimateTagWarrior模组加入Tag，但是只要Tag是中文的，启用rewrite之后，均不能正常显示，全部报404错误。经过长时间的跟踪终于发现问题了。以下以<font color="#808080">http://xuplus.com/tag/合肥</font> 为例。</font></p>
<p><font size="3"><font style="background-color: #99ccff">wp-includes</font>下<font style="background-color: #99ccff">classes.<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a></font>文件61行附近<br />
             <span class="Code"><font size="3">$</font><font size="3">req_uri = str_replace($pathinfo, ”, $req_uri);</font></span></font><span class="Code"><br />
</span>这行代码主要作用是将$reg_uri赋值/tag，但运行时 pathinfo为 合肥 req_url为/tag/%E5%90%88%E8%82%A5，这样并不能完成替换操作给$reg_uri赋值/tag。替换成<br />
             <span class="Code">$req_uri = urldecode(str_replace(urlencode($pathinfo), ”, str_replace(&#8216;/&#8217;,'%2F&#8217;,$req_uri)));<br />
</span>             //Modified By XuYong 修正url中有中文字符的问题$pathinfo被urldecode了,导致不能正常工作的问题</p>
<p>即可正常访问。</p>

	标签： <a href="http://xuplus.com/article/tag/404%e9%94%99%e8%af%af" title="404错误" rel="tag">404错误</a>, <a href="http://xuplus.com/article/tag/tag%e6%8f%92%e4%bb%b6" title="tag插件" rel="tag">tag插件</a>, <a href="http://xuplus.com/article/tag/ultimatetagwarrior" title="UltimateTagWarrior" rel="tag">UltimateTagWarrior</a>, <a href="http://xuplus.com/article/tag/wordpress" title="Wordpress" rel="tag">Wordpress</a>, <a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87" title="中文" rel="tag">中文</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/04/a16.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xoops中FCKeditor的上传文件时中文文件名解决方案</title>
		<link>http://xuplus.com/article/2007/04/a8.html</link>
		<comments>http://xuplus.com/article/2007/04/a8.html#comments</comments>
		<pubDate>Thu, 12 Apr 2007 10:22:43 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[上传]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=8</guid>
		<description><![CDATA[使用FCKeditor上传图片、Flash等文件时，文件名中的中文会显示为乱码并在在服务器上面保存有些全部为乱码文件，不能正常显示，在网上搜了一下前辈们的解决方法，没找到很好的解决办法。看来还有N多的人和我一样的困惑，但解决办法又如此的简单： 将 editor\filemanager\browser\default\frmupload.html 文件的编码改为UTF-8即可。 如果不能解决则 编辑upload.php文件 // Compose the file path. //Modifyed By XuYong 修正UTF-8的问题 $sFileName =iconv(“utf-8&#8243;,”gbk”,$sFileName); //End Modifyed 环境XOOPS 2.0.16 UTF-8 标签： article, fckeditor, XOOPS, 上传, 中文]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 10pt">使用FCKeditor上传图片、Flash等文件时，文件名中的中文会显示为乱码并在在服务器上面保存有些全部为乱码文件，不能正常显示，在网上搜了一下前辈们的解决方法，没找到很好的解决办法。看来还有N多的人和我一样的困惑，但解决办法又如此的简单： </span></p>
<p><span style="font-size: 10pt">将 editor\filemanager\browser\default\frmupload.html 文件的编码改为UTF-8即可。 </span></p>
<p><span style="font-size: 10pt">如果不能解决则 </span></p>
<p><span style="font-size: 10pt">编辑upload.php文件 </span></p>
<p><span style="font-size: 10pt">// Compose the file path. </span></p>
<p><span style="font-size: 10pt">//Modifyed By XuYong 修正UTF-8的问题 </span></p>
<p><span style="font-size: 10pt">$sFileName =iconv(“utf-8&#8243;,”gbk”,$sFileName); </span></p>
<p><span style="font-size: 10pt">//End Modifyed </span></p>
<p><span style="font-size: 10pt"></span>环境XOOPS 2.0.16 UTF-8</p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/fckeditor" title="fckeditor" rel="tag">fckeditor</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e4%b8%8a%e4%bc%a0" title="上传" rel="tag">上传</a>, <a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87" title="中文" rel="tag">中文</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/04/a8.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

