src/Str.php
public static function ucwords($input, $encoding = self::DEFAULT_ENCODING)
    {
        return function_exists('mb_convert_case')
            ? mb_convert_case($input, MB_CASE_TITLE, $encoding)
            : ucwords(strtolower($input));
    }
public static function ucwords($input, $encoding = self::DEFAULT_ENCODING)
    {
        return function_exists('mb_convert_case')
            ? mb_convert_case($input, MB_CASE_TITLE, $encoding)
            : ucwords(strtolower($input));
    }
public static function ucwords ( $ input , $ encoding = self :: DEFAULT_ENCODING ) { return function_exists ( 'mb_convert_case' ) ? mb_convert_case ( $ input , MB_CASE_TITLE , $ encoding ) : ucwords ( strtolower ( $ input ) ) ; }
Returns a string with the words capitalized.

Returns a string with the words capitalized. The $encoding parameter is used to determine the input string
encoding and thus use the proper method. The function uses mb_convert_case if present and falls back to ucwords.
The ucwords function normally does not lowercase the input string first, this function does.

@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 words capitalized
Returns a string with the words capitalized .