Skip to content

Commit

Permalink
When using libidn2, also try IDNA 2008 transitional
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Stieger committed May 23, 2017
1 parent d6e33ff commit 1e6a7b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions whois.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,8 @@ char *normalize_domain(const char *dom)
if (NULL != strchr(domain_start, ':'))
return ret;
if (idn2_lookup_ul(domain_start, &q, IDN2_NONTRANSITIONAL) != IDN2_OK)
return ret;
if (idn2_lookup_ul(domain_start, &q, IDN2_TRANSITIONAL) != IDN2_OK)
return ret;
#else
if (idna_to_ascii_lz(domain_start, &q, 0) != IDNA_SUCCESS)
return ret;
Expand All @@ -1206,7 +1207,8 @@ char *normalize_domain(const char *dom)
if (NULL != strchr(ret, ':'))
return ret;
if (idn2_lookup_ul(ret, &q, IDN2_NONTRANSITIONAL) != IDN2_OK)
return ret;
if (idn2_lookup_ul(ret, &q, IDN2_TRANSITIONAL) != IDN2_OK)
return ret;
#else
if (idna_to_ascii_lz(ret, &q, 0) != IDNA_SUCCESS)
return ret;
Expand Down

0 comments on commit 1e6a7b3

Please sign in to comment.