Mercurial > pidgin
changeset 9642:8901ef16f310
[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 <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 02 Aug 2004 03:33:00 +0000 |
parents | 9981fcce85c1 |
children | b8aee06adc83 |
files | src/util.c src/util.h |
diffstat | 2 files changed, 11 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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 *
--- 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.