What happens if you edit your copy (a core-file change, so be sure to make a backup) of /includes/functions/functions_general.php and change the zen_trunc_string function from
Code:
////
// Truncate a string
function zen_trunc_string($str = "", $len = 150, $more = 'true') {
if ($str == "") return $str;
if (is_array($str)) return $str;
$str = trim($str);
$len = (int)$len;
if ($len == 0) return '';
// if it's les than the size given, then return it
if (strlen($str) <= $len) return $str;
// else get that size of text
$str = substr($str, 0, $len);
// backtrack to the end of a word
if ($str != "") {
// check to see if there are any spaces left
if (!substr_count($str , " ")) {
if ($more == 'true') $str .= "...";
return $str;
}
// backtrack
while(strlen($str) && ($str[strlen($str)-1] != " ")) {
$str = substr($str, 0, -1);
}
$str = substr($str, 0, -1);
if ($more == 'true') $str .= "...";
if ($more != 'true' and $more != 'false') $str .= $more;
}
return $str;
}
to
Code:
////
// Truncate a string
function zen_trunc_string($str = "", $len = 150, $more = 'true') {
if ($str == "") return $str;
if (is_array($str)) return $str;
$str = trim($str);
$len = (int)$len;
if ($len == 0) return '';
// if it's les than the size given, then return it
if (mb_strlen($str) <= $len) return $str;
// else get that size of text
$str = mb_substr($str, 0, $len);
// backtrack to the end of a word
if ($str != "") {
// check to see if there are any spaces left
if (!mb_substr_count($str , " ")) {
if ($more == 'true') $str .= "...";
return $str;
}
// backtrack
while(mb_strlen($str) && ($str[mb_strlen($str)-1] != " ")) {
$str = mb_substr($str, 0, -1);
}
$str = mb_substr($str, 0, -1);
if ($more == 'true') $str .= "...";
if ($more != 'true' and $more != 'false') $str .= $more;
}
return $str;
}
... essentially using the multi-byte (mb_) form of those string-related functions?
Bookmarks