   def capitalize(string, mode \\ :default)
 
   def capitalize(<<char, rest::binary>>, :ascii) do
-    <<capitalize_ascii_char(char)>> <> downcase(rest, :ascii)
+    char = if char >= ?a and char <= ?z, do: char - 32, else: char
+    <<char>> <> downcase(rest, :ascii)
   end
 
   def capitalize(string, mode) when is_binary(string) do

    char <> downcase(rest, mode)
  end

  defp capitalize_ascii_char(char) when char >= ?a and char <= ?z, do: char - 32
  defp capitalize_ascii_char(char), do: char

  @doc """
  Converts only the first character in the given string to
  uppercase according to `mode`.

  `mode` may be `:default`, `:ascii` or `:greek`. The `:default` mode considers
  all non-conditional transformations outlined in the Unicode standard. `:ascii`
  lowercases only the letters A to Z. `:greek` includes the context sensitive
  mappings found in Greek.

  ## Examples

      iex> String.titlecase("abcd")
      "Abcd"

      iex> String.titlecase("ABCd")
      "ABCd"

      iex> String.titlecase("ﬁn")
      "Fin"

  Converts the first character in the given string to
  uppercase and the remainder to lowercase according to `mode`.

  `mode` may be `:default`, `:ascii` or `:greek`. The `:default`
  mode considers all non-conditional transformations outlined in
  the Unicode standard. `:ascii` lowercases only the letters A to Z.
  `:greek` includes the context sensitive mappings found in Greek.

  More precisely, it converts the first character to titlecase.
  If you want to convert only the first character without downcasing
  the rest of the string, see `titlecase/2`.

  ## Examples

      iex> String.capitalize("abcd")
      "Abcd"

      iex> String.capitalize("OS")
      "Os"

      iex> String.capitalize("ﬁn")
      "Fin"

