]> git.wh0rd.org Git - tt-rss.git/commitdiff
truncate_string() now actually is utf-8 compatible
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 31 Dec 2005 05:38:40 +0000 (06:38 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 31 Dec 2005 05:38:40 +0000 (06:38 +0100)
functions.php

index f40ce7618461c2f1d4aa2eca018b2a134628a836..7d65c903863bc92b2e604ea64e1cbd6bfb80aa14 100644 (file)
        }
 
        function truncate_string($str, $max_len) {
-               if (mb_strlen($str) > $max_len - 3) {
-                       return mb_substr($str, 0, $max_len) . "...";
+               if (mb_strlen($str, "utf-8") > $max_len - 3) {
+                       return mb_substr($str, 0, $max_len, "utf-8") . "...";
                } else {
                        return $str;
                }