diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2017-01-13 09:36:33 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-01-13 10:21:25 +0100 |
commit | f30cbcac11f5a627992f0c48cff91135808fa70f (patch) | |
tree | 069541a00bd1ca635b6e59deecfc3523f91c34a1 /lib/url.c | |
parent | cd6b99ef324a047c5dc49bbf27c1d40a3de2b14d (diff) | |
download | curl-f30cbcac11f5a627992f0c48cff91135808fa70f.tar.gz |
IDN: Use TR46 'transitional' for toASCII translations
References: http://unicode.org/faq/idn.html
http://unicode.org/reports/tr46
Closes #1206
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -4010,7 +4010,12 @@ static void fix_hostname(struct connectdata *conn, struct hostname *host) #ifdef USE_LIBIDN2 if(idn2_check_version(IDN2_VERSION)) { char *ace_hostname = NULL; - int rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, 0); +#ifdef IDN2_TRANSITIONAL + int flags = IDN2_NFC_INPUT | IDN2_TRANSITIONAL; +#else + int flags = IDN2_NFC_INPUT; +#endif + int rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, flags); if(rc == IDN2_OK) { host->encalloc = (char *)ace_hostname; /* change the name pointer to point to the encoded hostname */ |