Must be added an extra param `$encoding = 'UTF-8'` by default. It must be used in `return` line: `return trim(mb_substr($string, 0, $length, $encoding)) . $suffix;`