Allow Chinese/Japanese UTF-8 strings to be truncated at character

boundaries instead of word boundaries. (fix MDL-5378)
This commit is contained in:
martinlanghoff 2006-09-28 00:10:23 +00:00
parent 6402cd4679
commit c0adb54de4

View File

@ -5608,6 +5608,9 @@ function shorten_text($text, $ideal=30) {
if ($char == '.' or $char == ' ') {
$truncate = $i+1;
break 2;
} else if (ord($char) >= 0xE0) {
$truncate = $i;
break 2;
}
}
$count++;