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:15 +00:00
parent 498ce7e832
commit d0f5c048e2
+3
View File
@@ -6079,6 +6079,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++;