src/Str.php
public static function ucfirst($input, $encoding = self::DEFAULT_ENCODING)
    {
        return function_exists('mb_strtoupper')
            ? mb_strtoupper(mb_substr($input, 0, 1, $encoding), $encoding) .
            mb_substr($input, 1, mb_strlen($input, $encoding), $encoding)
            : ucfirst($input);
    }
public static function ucfirst($input, $encoding = self::DEFAULT_ENCODING)
    {
        return function_exists('mb_strtoupper')
            ? mb_strtoupper(mb_substr($input, 0, 1, $encoding), $encoding) .
            mb_substr($input, 1, mb_strlen($input, $encoding), $encoding)
            : ucfirst($input);
    }
public static function ucfirst ( $ input , $ encoding = self :: DEFAULT_ENCODING ) { return function_exists ( 'mb_strtoupper' ) ? mb_strtoupper ( mb_substr ( $ input , 0 , 1 , $ encoding ) , $ encoding ) . mb_substr ( $ input , 1 , mb_strlen ( $ input , $ encoding ) , $ encoding ) : ucfirst ( $ input ) ; }
Returns a string with the first char as uppercase.

Returns a string with the first char as uppercase. The other characters in the string are left untouched.
The $encoding parameter is used to determine the input string encoding and thus use the proper method.
The function uses mb_strtoupper, mb_mb_substr and mb_strlen if present and falls back to ucfirst.

@author FuelPHP (http://fuelphp.com)

@param string $input    The input string
@param string $encoding The encoding of the input string

@return string The string with the first char uppercased
Returns a string with the first char as uppercase .