<?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: Multibyte String Truncate Modifier for Smarty &#8211; mb_truncate</title>
	<atom:link href="http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Fri, 30 Jul 2010 09:05:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Thomas</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-29249</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Wed, 24 Feb 2010 12:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-29249</guid>
		<description>Nice plugin, works even better if previously suggested changes are made.

Additionally one can change the order of the function arguments. To match the order of things with classic smarty truncate, the charset should be passed after breakwords, so it would be:
$string, $length, $etc, $break_words ...

I placed that as last param, as php`s mb_ functions.

You can now prepend mb_ on all existing truncate modifier calls within the templates.

This is a very easy task using find/replace, which won&#039;t do so well with original argument order.
It would pass the former break_words as charset, mb_ functions will not be happy with it.</description>
		<content:encoded><![CDATA[<p>Nice plugin, works even better if previously suggested changes are made.</p>
<p>Additionally one can change the order of the function arguments. To match the order of things with classic smarty truncate, the charset should be passed after breakwords, so it would be:<br />
$string, $length, $etc, $break_words &#8230;</p>
<p>I placed that as last param, as php`s mb_ functions.</p>
<p>You can now prepend mb_ on all existing truncate modifier calls within the templates.</p>
<p>This is a very easy task using find/replace, which won&#8217;t do so well with original argument order.<br />
It would pass the former break_words as charset, mb_ functions will not be happy with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladimir Dokuzanov</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-24460</link>
		<dc:creator>Vladimir Dokuzanov</dc:creator>
		<pubDate>Sat, 24 Oct 2009 22:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-24460</guid>
		<description>Thanks for this plugin.
There is a small problem in the code.
On line 36 and line 37 instead of strlen must be used mb_strlen.
So it should be:
    if (mb_strlen($string, $charset) &gt; $length) {
        $length -= min($length, mb_strlen($etc, $charset));

:)</description>
		<content:encoded><![CDATA[<p>Thanks for this plugin.<br />
There is a small problem in the code.<br />
On line 36 and line 37 instead of strlen must be used mb_strlen.<br />
So it should be:<br />
    if (mb_strlen($string, $charset) &gt; $length) {<br />
        $length -= min($length, mb_strlen($etc, $charset));</p>
<p> <img src='http://www.guyrutenberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hen</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-22111</link>
		<dc:creator>Hen</dc:creator>
		<pubDate>Fri, 31 Jul 2009 08:51:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-22111</guid>
		<description>Great work,
I have exactly the problem you described in your post. Thanks for this plugin.</description>
		<content:encoded><![CDATA[<p>Great work,<br />
I have exactly the problem you described in your post. Thanks for this plugin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-17728</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 26 Mar 2009 14:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-17728</guid>
		<description>tics +1</description>
		<content:encoded><![CDATA[<p>tics +1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tics</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-17221</link>
		<dc:creator>tics</dc:creator>
		<pubDate>Wed, 18 Mar 2009 12:41:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-17221</guid>
		<description>In UTF8, if you don’t put “/u” at the end of pattern, you may have a problem at the end of accentued caracters.

$string = preg_replace(’/\s+?(\S+)?$/u’, ”, mb_substr($string, 0, $length+1, $charset));

Best regards
tics</description>
		<content:encoded><![CDATA[<p>In UTF8, if you don’t put “/u” at the end of pattern, you may have a problem at the end of accentued caracters.</p>
<p>$string = preg_replace(’/\s+?(\S+)?$/u’, ”, mb_substr($string, 0, $length+1, $charset));</p>
<p>Best regards<br />
tics</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tics</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-17219</link>
		<dc:creator>tics</dc:creator>
		<pubDate>Wed, 18 Mar 2009 12:40:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-17219</guid>
		<description>If you don&#039;t put &quot;/u&quot; at the end of pattern, you may have a problem at the end of accentued caracters.

$string = preg_replace(&#039;/\s+?(\S+)?$/u&#039;, &#039;&#039;, mb_substr($string, 0, $length+1, $charset));

Best regards
tics</description>
		<content:encoded><![CDATA[<p>If you don&#8217;t put &#8220;/u&#8221; at the end of pattern, you may have a problem at the end of accentued caracters.</p>
<p>$string = preg_replace(&#8216;/\s+?(\S+)?$/u&#8217;, &#8221;, mb_substr($string, 0, $length+1, $charset));</p>
<p>Best regards<br />
tics</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alemartini</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-13648</link>
		<dc:creator>alemartini</dc:creator>
		<pubDate>Fri, 13 Feb 2009 20:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-13648</guid>
		<description>Thank you very much for sharing this code!

It helped me fix an annoying bug in my weblog, which relies on Smarty.

Best regards,
Alex</description>
		<content:encoded><![CDATA[<p>Thank you very much for sharing this code!</p>
<p>It helped me fix an annoying bug in my weblog, which relies on Smarty.</p>
<p>Best regards,<br />
Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 9h0st</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-12837</link>
		<dc:creator>9h0st</dc:creator>
		<pubDate>Sun, 08 Feb 2009 22:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-12837</guid>
		<description>wow! thanks great work!</description>
		<content:encoded><![CDATA[<p>wow! thanks great work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-10305</link>
		<dc:creator>Guy</dc:creator>
		<pubDate>Fri, 30 Jan 2009 16:26:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-10305</guid>
		<description>@muthu: Thanks, I updated the post and removed the extra mb_truncate from the example.</description>
		<content:encoded><![CDATA[<p>@muthu: Thanks, I updated the post and removed the extra mb_truncate from the example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muthu muttu</title>
		<link>http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/comment-page-1/#comment-10285</link>
		<dc:creator>muthu muttu</dc:creator>
		<pubDate>Fri, 30 Jan 2009 14:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/04/multibyte-string-truncate-modifier-for-smarty-mb_truncate/#comment-10285</guid>
		<description>{$some_string&#124;mb_truncate:13:&quot;...&quot;:&#039;UTF-8&#039;}
This is the right syntax to truncate.....
:)</description>
		<content:encoded><![CDATA[<p>{$some_string|mb_truncate:13:&#8221;&#8230;&#8221;:&#8217;UTF-8&#8242;}<br />
This is the right syntax to truncate&#8230;..<br />
 <img src='http://www.guyrutenberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.413 seconds -->
