<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 修復 recent comments 把中文字切一半的問題</title>
	<atom:link href="http://www.jeffhung.net/blog/articles/jeffhung/337/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeffhung.net/blog/articles/jeffhung/337/</link>
	<description>(My smile insists of having nose. :-)</description>
	<lastBuildDate>Thu, 03 Nov 2011 00:43:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2-alpha</generator>
	<item>
		<title>By: andy</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/337/comment-page-1/#comment-8049</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Fri, 01 Sep 2006 19:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.idv.tw/blog/articles/jeffhung/337/#comment-8049</guid>
		<description>因為全形字佔位大約是半形字的兩倍，若我想限定句字的長度以免換行，而在後端加上『...』。想請問若以 JavaScript 來切字可否做到全形字作兩個字元計算？
我試過用 substring()，它把全形字當一個字元計算的。</description>
		<content:encoded><![CDATA[<p>因為全形字佔位大約是半形字的兩倍，若我想限定句字的長度以免換行，而在後端加上『...』。想請問若以 JavaScript 來切字可否做到全形字作兩個字元計算？<br />
我試過用 substring()，它把全形字當一個字元計算的。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 1614</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/337/comment-page-1/#comment-400</link>
		<dc:creator>1614</dc:creator>
		<pubDate>Tue, 01 Nov 2005 14:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.idv.tw/blog/articles/jeffhung/337/#comment-400</guid>
		<description>非常感謝！有趣的是原始碼裡的格式看起來簡直就像是之前就有這段，但是最後被抽走似的。有種玩拼圖的感覺。

關於英文分屍，我發現是 wordwrap() 的問題。只要試著把 wrap long words 選項設小一點就會發現中文句子被他插空格變得七零八落，這是其一。其二是若有中英夾雜，而中英之間沒有留空格的話，就會有英文（即使是很短的字也一樣）被分屍：例如「很多中文abc」這段全無空格，就會在英文部份被分屍或在中文部份被插入空格。中文被插空格短期勉強可以忍受，英文單字分屍就超出我身為文字工作者的容忍範圍了。（笑）

若是以「不破壞版面」為目的，則理想的 wordwrap() 我想應該是要能夠不計 CJK，只針對字串中的非 CJK 字元計算字數來切斷吧。

不過已經很感謝您修好中文的問題了，其他的只是閒聊罷了。 =)</description>
		<content:encoded><![CDATA[<p>非常感謝！有趣的是原始碼裡的格式看起來簡直就像是之前就有這段，但是最後被抽走似的。有種玩拼圖的感覺。</p>
<p>關於英文分屍，我發現是 wordwrap() 的問題。只要試著把 wrap long words 選項設小一點就會發現中文句子被他插空格變得七零八落，這是其一。其二是若有中英夾雜，而中英之間沒有留空格的話，就會有英文（即使是很短的字也一樣）被分屍：例如「很多中文abc」這段全無空格，就會在英文部份被分屍或在中文部份被插入空格。中文被插空格短期勉強可以忍受，英文單字分屍就超出我身為文字工作者的容忍範圍了。（笑）</p>
<p>若是以「不破壞版面」為目的，則理想的 wordwrap() 我想應該是要能夠不計 CJK，只針對字串中的非 CJK 字元計算字數來切斷吧。</p>
<p>不過已經很感謝您修好中文的問題了，其他的只是閒聊罷了。 =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 阿亮遇見熊</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/337/comment-page-1/#comment-30872</link>
		<dc:creator>阿亮遇見熊</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.idv.tw/blog/articles/jeffhung/337/#comment-30872</guid>
		<description>  一直看我的 Recent Comment 不順眼，常常一大串留言，就變成只有 ... 三個字元。而且有斷在中文字，而變成亂碼的情形。這個問題最後在 JeffHuang 的「修復 recent comments 把中文字切一半的問題[IMG] 」這篇找到答案，只要 PHP 的 mb_strimwidth()[IMG] 一行就好了，還好，不然原本還想去做 utf8 每個字元 length 計算哩。有時，還真是有意想不到的簡單解決方案。</description>
		<content:encoded><![CDATA[<p>一直看我的 Recent Comment 不順眼，常常一大串留言，就變成只有 ... 三個字元。而且有斷在中文字，而變成亂碼的情形。這個問題最後在 JeffHuang 的「修復 recent comments 把中文字切一半的問題[IMG] 」這篇找到答案，只要 PHP 的 mb_strimwidth()[IMG] 一行就好了，還好，不然原本還想去做 utf8 每個字元 length 計算哩。有時，還真是有意想不到的簡單解決方案。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 隨想部落格 » 旅行、影劇、閱讀……還有愛吃愛玩的隨想</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/337/comment-page-1/#comment-30873</link>
		<dc:creator>隨想部落格 » 旅行、影劇、閱讀……還有愛吃愛玩的隨想</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.idv.tw/blog/articles/jeffhung/337/#comment-30873</guid>
		<description>meta.php, monthly.php)  2) fix get-recent-comment 對UTF8字元的斷行。  由於此外掛在斷行時會破壞UTF8中文碼字元，造成無法通過W3C的檢查頁面。(我終於找到元凶了！)修改方法來自JeffHung.Blog。此篇有詳細的解決方法。  現在在W3C做檢查，終於可以跑出錯誤清單了。有一半是加入flickr相簿的語法問題，這部份我可以不用理會。至於其它錯誤，有時間會慢慢修正。 </description>
		<content:encoded><![CDATA[<p>meta.php, monthly.php)  2) fix get-recent-comment 對UTF8字元的斷行。  由於此外掛在斷行時會破壞UTF8中文碼字元，造成無法通過W3C的檢查頁面。(我終於找到元凶了！)修改方法來自JeffHung.Blog。此篇有詳細的解決方法。  現在在W3C做檢查，終於可以跑出錯誤清單了。有一半是加入flickr相簿的語法問題，這部份我可以不用理會。至於其它錯誤，有時間會慢慢修正。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 克力思汀，忙什麼?</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/337/comment-page-1/#comment-30874</link>
		<dc:creator>克力思汀，忙什麼?</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.idv.tw/blog/articles/jeffhung/337/#comment-30874</guid>
		<description> 問題1: 在option page裡出現fatal error  解決: http://www.jeffhung.net/blog/articles/jeffhung/316/  問題2: 留言中文字切一半變亂碼的問題  解決: 基本的解決方法是使用PHP multibyte string function來切留言  http://www.jeffhung.net/blog/articles/jeffhung/337/   </description>
		<content:encoded><![CDATA[<p>問題1: 在option page裡出現fatal error  解決: <a href="http://www.jeffhung.net/blog/articles/jeffhung/316/" rel="nofollow">http://www.jeffhung.net/blog/articles/jeffhung/316/</a>  問題2: 留言中文字切一半變亂碼的問題  解決: 基本的解決方法是使用PHP multibyte string function來切留言  <a href="http://www.jeffhung.net/blog/articles/jeffhung/337/" rel="nofollow">http://www.jeffhung.net/blog/articles/jeffhung/337/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 從來不吃人肉</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/337/comment-page-1/#comment-30875</link>
		<dc:creator>從來不吃人肉</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.idv.tw/blog/articles/jeffhung/337/#comment-30875</guid>
		<description> 晚上九點多的時候，寶貝說可以裝一下 get recent comments，參考了寶貝寫的修改文件，寶貝真厲害（＊＿＊崇拜～） 然後覺得sidebar排版不好看，動手調了一下，然後又覺得照片底下的那個空間好小，不知道寫什麼好，自我介紹也已經寫在「about-關於我」這篇文章裡了</description>
		<content:encoded><![CDATA[<p>晚上九點多的時候，寶貝說可以裝一下 get recent comments，參考了寶貝寫的修改文件，寶貝真厲害（＊＿＊崇拜～） 然後覺得sidebar排版不好看，動手調了一下，然後又覺得照片底下的那個空間好小，不知道寫什麼好，自我介紹也已經寫在「about-關於我」這篇文章裡了</p>
]]></content:encoded>
	</item>
	<item>
		<title>By:  Cd Chen’s webLog</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/337/comment-page-1/#comment-49097</link>
		<dc:creator> Cd Chen’s webLog</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.idv.tw/blog/articles/jeffhung/337/#comment-49097</guid>
		<description>不過，mod_janews 會有一個缺點，就是無法 (沒有) 處理中文字的斷行問題，這樣會造成在不該的地方亂斷行。例如：  應該在這裡斷行的，卻斷在?…  後來翻到 “修復 recent comments 把中文字切一半的問題” 這篇文章，參考其中的作法，稍作修改。現在，總算可以正確的斷行了!! </description>
		<content:encoded><![CDATA[<p>不過，mod_janews 會有一個缺點，就是無法 (沒有) 處理中文字的斷行問題，這樣會造成在不該的地方亂斷行。例如：  應該在這裡斷行的，卻斷在?…  後來翻到 “修復 recent comments 把中文字切一半的問題” 這篇文章，參考其中的作法，稍作修改。現在，總算可以正確的斷行了!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

