Use TR46 non-transitional with libidn2 >= 0.14

I changed my mind after talking with the cURL
maintainer Daniel Stenberg.
See https://github.com/curl/curl/pull/1207
This commit is contained in:
Tim Rühsen 2017-01-14 15:47:44 +01:00
parent 71059c2c6d
commit 526768cc5d
1 changed files with 7 additions and 3 deletions

View File

@ -704,10 +704,14 @@ static int _psl_idna_toASCII(_psl_idna_t *idna _UNUSED, const char *utf8, char *
#if IDN2_VERSION_NUMBER >= 0x00140000
int rc;
/* IDN2_TRANSITIONAL automatically converts to lowercase */
/* IDN2_NFC_INPUT converts to NFC before toASCII conversion */
/* IDN2_TRANSITIONAL automatically converts to lowercase
* IDN2_NFC_INPUT converts to NFC before toASCII conversion
* Since IDN2_TRANSITIONAL implicitely does NFC conversion, we don't need
* the additional IDN2_NFC_INPUT. But just for the unlikely case that the linked
* library is not matching the headers when building and it doesn't support TR46,
* we provide IDN2_NFC_INPUT. */
if ((rc = idn2_lookup_u8((uint8_t *)utf8, (uint8_t **)ascii, IDN2_NFC_INPUT | IDN2_TRANSITIONAL)) == IDN2_OK)
if ((rc = idn2_lookup_u8((uint8_t *)utf8, (uint8_t **)ascii, IDN2_NFC_INPUT | IDN2_NONTRANSITIONAL)) == IDN2_OK)
ret = 0;
/* else
fprintf(stderr, "toASCII(%s) failed (%d): %s\n", lower, rc, idn2_strerror(rc)); */