Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

truncate counts entities as length > 1

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
Dolgan
Smarty Rookie


Joined: 24 Aug 2004
Posts: 8

PostPosted: Mon Oct 25, 2004 8:37 am    Post subject: truncate counts entities as length > 1 Reply with quote

Hi!

It seems as if truncate counts for example & as 6 chars where it should count only as one.
Does anyone have a workaround for this?
I am using smarty 2.6.2, but the changelog doesn't adress this problem. If it is already fixed, please tell me so.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Oct 25, 2004 8:46 am    Post subject: Reply with quote

'&' counts as 1 character. what you mean seems to be '&' which would count 5 characters.

(or your post got mangled by this dumb forum).

anyway: you have to html_entity_decode your strings if you want truncate to get it right.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dolgan
Smarty Rookie


Joined: 24 Aug 2004
Posts: 8

PostPosted: Mon Oct 25, 2004 8:52 am    Post subject: Reply with quote

I wrote & uuml ; (without spaces) - it seems to be the forum...
html_entity_decode seems to work... thank you. (But still... isn't it strange to count entities as seperate chars?)
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Oct 25, 2004 9:03 am    Post subject: Reply with quote

Dolgan wrote:
But still... isn't it strange to count entities as seperate chars?


smarty doesn't know about the anatomy of the string you pass and the string you want. even if it would html_entitiy_decode on it's own (which would be bad if you pass plain text to it) then it wouldn't know the target encoding.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP