Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jutil.c @ 27711:7fbf964c6c6c
Move the IDN support into the DNS routines.
This turned out to be cleaner than I first thought, so here we go.
All libpurple DNS routines support IDN when built against GNU libidn.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sun, 19 Jul 2009 23:45:13 +0000 |
parents | e5fdfff98aa9 |
children | e8ec4a3e6706 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jutil.c Sun Jul 19 22:40:10 2009 +0000 +++ b/libpurple/protocols/jabber/jutil.c Sun Jul 19 23:45:13 2009 +0000 @@ -37,28 +37,6 @@ static char idn_buffer[1024]; #endif -gchar *jabber_try_idna_to_ascii(const char *input) -{ -#ifndef USE_IDN - return g_strdup(input); -#else - gchar *out; - char *tmp; - - g_return_val_if_fail(input != NULL, NULL); - g_return_val_if_fail(*input != '\0', NULL); - - if (idna_to_ascii_8z(input, &tmp, IDNA_USE_STD3_ASCII_RULES) != IDNA_SUCCESS) { - return NULL; - } - - out = g_strdup(tmp); - /* This *MUST* be freed with free, not g_free */ - free(tmp); - return out; -#endif -} - #ifdef USE_IDN static gboolean jabber_nodeprep(char *str, size_t buflen) {