Could you try replacing the truncate function in application/helpers/format.php for this?:
function truncate($string, $length, $etc = '...', $charset='UTF-8',
$break_words = false, $middle = false)
{
if ($length == 0)
return '';
if (function_exists('mb_strlen')) {
$len = mb_strlen($string);
$lenetc = mb_strlen($etc);
} else {
$len = strlen($string);
$lenetc = strlen($etc);
}
if ($len > $length) {
$length -= min($length, $lenetc);
if (!$break_words && !$middle) {
if(function_exists('mb_substr')) {
$string = preg_replace('/\s+?(\S+)?$/', '', mb_substr($string, 0, $length+1, $charset));
} else {
$string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1));
}
}
if(!$middle) {
if(function_exists('mb_substr')) {
return mb_substr($string, 0, $length, $charset) . $etc;
} else {
return substr($string, 0, $length) . $etc;
}
} else {
if(function_exists('mb_substr')) {
return mb_substr($string, 0, $length/2, $charset) . $etc . mb_substr($string, -$length/2, $charset);
} else {
return substr($string, 0, $length/2) . $etc . substr($string, -$length/2);
}
}
} else {
return $string;
}
}
Please tell me if it works for you. Backup the file first so that you can go back if it doesn't do the trick.
Thanks.