* @return string
*/
public static function ellipsify($string, $maxLen) {
- $len = strlen($string);
+ $len = mb_strlen($string, 'UTF-8');
if ($len <= $maxLen) {
return $string;
}
else {
$end = $maxLen - 3;
- while (strlen($string) > $maxLen - 3) {
+ while (mb_strlen($string, 'UTF-8') > $maxLen - 3) {
$string = mb_substr($string, 0, $end, 'UTF-8');
$end = $end - 1;
}