public function getCharset() { return $this->charset; }
function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $separator = '...') { if (mb_strlen($value, $env->getCharset()) > $length) { return mb_substr($value, 0, $length, $env->getCharset()) . $separator; } return $value; }