mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Emit warning on IDN output failure
Warning is emitted before any dig headers.
This commit is contained in:
parent
ac0cf85f09
commit
21371abd72
1 changed files with 7 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue