From: Petr Menšík Date: Wed, 30 Jan 2019 14:38:54 +0000 (+0100) Subject: Emit warning on IDN output failure X-Git-Tag: v9.15.5~12^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21371abd729e1dac0565425f1d5330c181c401ee;p=thirdparty%2Fbind9.git Emit warning on IDN output failure Warning is emitted before any dig headers. --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 5bc3534bfca..3751d799d9c 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -4421,16 +4421,19 @@ idn_ace_to_locale(const char *src, char **dst) { */ res = idn2_to_unicode_8zlz(utf8_src, &local_src, 0); if (res != IDN2_OK) { - /* - * Cannot represent in current locale. - * Output ACE form undecoded. - */ + static bool warned = false; + res = idn2_to_ascii_8z(utf8_src, &local_src, 0); if (res != IDN2_OK) { fatal("Cannot represent '%s' " "in the current locale nor ascii (%s), " "use +noidnout or a different locale", src, idn2_strerror(res)); + } else if (!warned) { + fprintf(stderr, ";; Warning: cannot represent '%s' " + "in the current locale", + local_src); + warned = true; } }