truncate problem

Hi,   In my application I am using a list box where i am showing different groups   name. I am using <%=truncate_html_strip_textual_wrap(group.name,28,28)%>   for truncating the name but it gives me problem when group name come   like Shital's friends from "Office" Group this

   In list box it showing as a Shital's friends from & quote..    how to avoid such a thing? whats a proper way for handling such a situations?

character like single quote, double quote, ampersand not truncated properly

truncate before you escape html entities.

Fred

Could you explain with an example I am not understanding you?

Could you explain with an example I am not understanding you?

Your problem is that truncating works on a character by character
basis, which has the inbuilt assumption that it's ok to cut off at any
point. If you have for example &amp; then it's not find to cut in the middle
of that. Therefore it is a lot easier to do any truncation before you
stick in the &amp; and other things like that (or write a version of
truncate that understands entities and that they should not be messed
with.

Fred

Ok, Thanks for suggestion do you know any JavaScript for handling such issue I am understanding it correctly.