|
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 |
Dolgan Smarty Rookie
Joined: 24 Aug 2004 Posts: 8
|
Posted: Mon Oct 25, 2004 8:37 am Post subject: truncate counts entities as length > 1 |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Oct 25, 2004 8:46 am Post subject: |
|
|
'&' 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 |
|
Dolgan Smarty Rookie
Joined: 24 Aug 2004 Posts: 8
|
Posted: Mon Oct 25, 2004 8:52 am Post subject: |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Oct 25, 2004 9:03 am Post subject: |
|
|
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 |
|
|
|
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
|