summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-12-31 06:38:40 +0100
committerAndrew Dolgov <[email protected]>2005-12-31 06:38:40 +0100
commit12db369ca71f3ba1cfadd8890ebcb203927083f6 (patch)
treeed2017ee38965e2e9ca399908f0555173d6ff0db /functions.php
parent7d8d10c6ed5110c96204cc2d455dd04e93c6c196 (diff)
truncate_string() now actually is utf-8 compatible
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index f40ce7618..7d65c9038 100644
--- a/functions.php
+++ b/functions.php
@@ -821,8 +821,8 @@
}
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;
}