Truncate textarea not working for double-byte characters

boyjah

Member
My site is English and Japanese. I use the truncate function for a textarea in list view. It works for the English side but seems to have no effect for the Japanese characters. No matter what I set the truncate number to it always shows the entire text. I tried setting Retain HTML to Yes but then all it does is show ... for all messages, with no truncated text characters showing at all unless the original text is very short.

My lists are all set to same collation as the database: utf8_general_ci
 
Last edited:
Yes. "Retain HTML" (=count chars) code looks pretty complicated (counting the characters via regex which seems to skip special characters) and "no HTML" is searching for spaces to count the words. It's doing also for Japanese characters in my test but I assume usually you dont have spaces in such a text?

You may use custom CSS like

.test2___feld span.fabrikTip {
width: 50px;
background: yellow;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block!important;}

to truncate
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top