From: martinlanghoff Date: Thu, 28 Sep 2006 00:10:23 +0000 (+0000) Subject: Allow Chinese/Japanese UTF-8 strings to be truncated at character X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c0adb54de44c290e604fbc8a9c3c865648e60748;p=moodle.git Allow Chinese/Japanese UTF-8 strings to be truncated at character boundaries instead of word boundaries. (fix MDL-5378) --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index a6b1d975c7..218e6de3f8 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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++;