shell_util_normalize_and_casefold: New utility function

Merge the duplicated copies into shell-util.
This commit is contained in:
Colin Walters
2011-08-10 12:58:40 -04:00
parent 10dcc100e9
commit c5de239e25
4 changed files with 23 additions and 32 deletions

View File

@ -506,6 +506,20 @@ shell_util_get_transformed_allocation (ClutterActor *actor,
box->y2 = y_max;
}
char *
shell_util_normalize_and_casefold (const char *str)
{
char *normalized, *result;
if (str == NULL)
return NULL;
normalized = g_utf8_normalize (str, -1, G_NORMALIZE_ALL);
result = g_utf8_casefold (normalized, -1);
g_free (normalized);
return result;
}
/**
* shell_util_format_date:
* @format: a strftime-style string format, as parsed by