static function lessenAsEncoding($str, $length = 255, $tail = '...') { $context = \CADB\Model\Context::getInstance(); if ($context->getProperty('database.utf8') != true) { return UTF8::lessen($str, $length, $tail); } else { return UTF8::lessenAsByte($str, $length, $tail); } }