public static function substr($str, $start, $length = null)
    {
        if (function_exists('mb_substr')) {
            return mb_substr($str, $start, $length, 'utf-8');
        }
        if ($length === null) {
            return substr($str, $start);
        }
        return substr($str, $start, $length);
    }