mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Allow Chinese/Japanese UTF-8 strings to be truncated at character
boundaries instead of word boundaries. (fix MDL-5378)
This commit is contained in:
parent
6402cd4679
commit
c0adb54de4
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user