]> git.mjollnir.org Git - moodle.git/commitdiff
Comments.
authormartinlanghoff <martinlanghoff>
Thu, 28 Sep 2006 00:13:07 +0000 (00:13 +0000)
committermartinlanghoff <martinlanghoff>
Thu, 28 Sep 2006 00:13:07 +0000 (00:13 +0000)
lib/moodlelib.php

index 218e6de3f8be295d3badf5a12ce0e91d6d6376c8..7de98adeb3c3f3959035b7c25b2c513d6149f64f 100644 (file)
@@ -5608,9 +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;
+                       } else if (ord($char) >= 0xE0) {  // Chinese/Japanese/Korean text
+                           $truncate = $i;               // can be truncated at any UTF-8
+                           break 2;                      // character boundary.
                        }
                    }
                    $count++;