|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
yarco Smarty Regular
Joined: 20 Mar 2009 Posts: 39
|
Posted: Wed Feb 29, 2012 5:55 pm Post subject: truncate string error? |
|
|
Dont know what's going on...
It's ok when dealing Chinese, but except these characters:
Alewijnse Marine Systems
I dont know why this string can not be truncated in:
{$node.content|stripslashes|truncate:80}
It would give me:
Alewijnse Marine...
Any idea?(it is really far away from 80 characters) |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Wed Feb 29, 2012 5:58 pm Post subject: |
|
|
Which version of Smarty are you using? Which charset / encoding are you working with? _________________ Twitter |
|
Back to top |
|
yarco Smarty Regular
Joined: 20 Mar 2009 Posts: 39
|
Posted: Thu Mar 01, 2012 4:15 am Post subject: |
|
|
rodneyrehm wrote: | Which version of Smarty are you using? Which charset / encoding are you working with? |
==============
found in Smarty.class.php
* @version 3.1.7
* SVN: $Id: Smarty.class.php 4518 2011-12-18 18:48:07Z rodneyrehm $
==============
And the charset/encoding is UTF8.
Article is here: http://www.haibangindustrial.com/?a=news&id=1 (in Chinese)
List is here: http://www.haibangindustrial.com/?a=newslist (the first news)
And now i fixed it in php. When output a list, i did
mb_substr(striptags($content), 0, 80)
And in template:
{$content|stripslashes}...
(oh, seems i also need to do stripslashes in php first)
So never mind, now. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|