From c0adb54de44c290e604fbc8a9c3c865648e60748 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Thu, 28 Sep 2006 00:10:23 +0000 Subject: [PATCH] Allow Chinese/Japanese UTF-8 strings to be truncated at character boundaries instead of word boundaries. (fix MDL-5378) --- lib/moodlelib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index a6b1d975c7f..218e6de3f8b 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++;