Permalink
Browse files

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

boundaries instead of word boundaries. (fix MDL-5378)
  • Loading branch information...
1 parent 498ce7e commit d0f5c048e2d6e95fbb12c293606b74c8ba5e9dd8 martinlanghoff committed Sep 28, 2006
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/moodlelib.php
View
@@ -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++;

0 comments on commit d0f5c04

Please sign in to comment.