X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Furl.c;h=8692e689500e1ddc8a7b30a986a1e36e4b72d7a6;hb=5a2e836b77304d12730747efd8aa24c6f442c69f;hp=328256643ce2511f55e9bd1af37c7adf07ad85c7;hpb=4edeecae05b1660a777f99947472bc8d32e34b68;p=platform%2Fupstream%2Fcurl.git diff --git a/lib/url.c b/lib/url.c index 3282566..8692e68 100644 --- a/lib/url.c +++ b/lib/url.c @@ -65,6 +65,8 @@ #elif defined(USE_WIN32_IDN) /* prototype for curl_win32_idn_to_ascii() */ bool curl_win32_idn_to_ascii(const char *in, char **out); +#elif defined(USE_GLIB2_HOSTNAME) +#include #endif /* USE_LIBIDN2 */ #include "urldata.h" @@ -4072,6 +4074,15 @@ static void fix_hostname(struct connectdata *conn, struct hostname *host) } else infof(data, "Failed to convert %s to ACE;\n", host->name); +#elif defined(USE_GLIB2_HOSTNAME) + gchar *ace_hostname = NULL; + ace_hostname = g_hostname_to_ascii(host->name); + if(ace_hostname) { + host->encalloc = (char *)ace_hostname; + host->name = host->encalloc; + } + else + infof(data, "Failed to convert %s to ACE;\n", host->name); #else infof(data, "IDN support not present, can't parse Unicode domains\n"); #endif