/* Returns: a newly allocated string, with all characters converted to lowercase.  */
gchar* g_utf8_strdown(const gchar *str, gssize len)
/* Returns: a newly allocated string, with all characters converted to lowercase.  */
gchar* g_utf8_strdown(const gchar *str, gssize len)
{
  gsize result_len;
  LocaleType locale_type;
  gchar *result;
  g_return_val_if_fail (str != NULL, NULL);
  locale_type = get_locale_type ();
  result_len = real_tolower (str, len, NULL, locale_type);
  result = g_malloc (result_len + 1);
  real_tolower (str, len, result, locale_type);
  result[result_len] = '\0';
  return result;
}