public static function str_max_bytes($string, $bytes) {
        if (function_exists('mb_strcut')) {
            return mb_strcut($string, 0, $bytes, 'UTF-8');
        }

        $oldlevel = error_reporting(E_PARSE);
        $result = self::typo3()->strtrunc('utf-8', $string, $bytes);
        error_reporting($oldlevel);

        return $result;
    }