/* Returns: a newly allocated string, with all the lower case characters in @str converted to upper case, with semantics that exactly match g_ascii_toupper(). (Note that this is unlike the old g_strup(), which modified the string in place.)  */
gchar* g_ascii_strup(const gchar *str, gssize len)
/* Returns: a newly allocated string, with all the lower case characters in @str converted to upper case, with semantics that exactly match g_ascii_toupper(). (Note that this is unlike the old g_strup(), which modified the string in place.)  */
gchar* g_ascii_strup(const gchar *str, gssize len)
{
  gchar *result, *s;
  g_return_val_if_fail (str != NULL, NULL);
  if (len < 0)
    len = strlen (str);
  result = g_strndup (str, len);
  for (s = result; *s; s++)
    *s = g_ascii_toupper (*s);
  return result;
}