# HG changeset patch # User Mark Doliner # Date 1091417580 0 # Node ID 8901ef16f310d83cf97a9396168286d21af15dbb # Parent 9981fcce85c16ad95979fb2fe41cb392e2503c1b [gaim-migrate @ 10490] Some changes that don't affect anything. Ethan might want to do something with this function? I'm too lazy to read the gaim-devel emails in detail. committer: Tailor Script diff -r 9981fcce85c1 -r 8901ef16f310 src/util.c --- a/src/util.c Mon Aug 02 03:24:11 2004 +0000 +++ b/src/util.c Mon Aug 02 03:33:00 2004 +0000 @@ -2948,11 +2948,11 @@ /************************************************************************** * UTF8 String Functions **************************************************************************/ -char * +gchar * gaim_utf8_try_convert(const char *str) { gsize converted; - char *utf8; + gchar *utf8; g_return_val_if_fail(str != NULL, NULL); @@ -2961,19 +2961,17 @@ } utf8 = g_locale_to_utf8(str, -1, &converted, NULL, NULL); - if (utf8) - return(utf8); - - g_free(utf8); + if (utf8 != NULL) + return utf8; utf8 = g_convert(str, -1, "UTF-8", "ISO-8859-15", &converted, NULL, NULL); - if (utf8 && converted == strlen (str)) { - return(utf8); - } else if (utf8) { + if ((utf8 != NULL) && (converted == strlen(str))) + return utf8; + + if (utf8 != NULL) g_free(utf8); - } - - return(NULL); + + return NULL; } char * diff -r 9981fcce85c1 -r 8901ef16f310 src/util.h --- a/src/util.h Mon Aug 02 03:24:11 2004 +0000 +++ b/src/util.h Mon Aug 02 03:33:00 2004 +0000 @@ -666,7 +666,7 @@ * * @return The UTF-8 string, or @c NULL if it could not be converted. */ -char *gaim_utf8_try_convert(const char *str); +gchar *gaim_utf8_try_convert(const char *str); /** * Compares two UTF-8 strings.