mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
Fallback to ASCII on output IDN conversion error
It is possible dig used ACE encoded name in locale, which does not support converting it to unicode. Instead of fatal error, fallback to ACE name on output.
This commit is contained in:
@@ -4421,10 +4421,18 @@ idn_ace_to_locale(const char *src, char **dst) {
|
|||||||
*/
|
*/
|
||||||
res = idn2_to_unicode_8zlz(utf8_src, &local_src, 0);
|
res = idn2_to_unicode_8zlz(utf8_src, &local_src, 0);
|
||||||
if (res != IDN2_OK) {
|
if (res != IDN2_OK) {
|
||||||
fatal("Cannot represent '%s' in the current locale (%s), "
|
/*
|
||||||
|
* Cannot represent in current locale.
|
||||||
|
* Output ACE form undecoded.
|
||||||
|
*/
|
||||||
|
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",
|
"use +noidnout or a different locale",
|
||||||
src, idn2_strerror(res));
|
src, idn2_strerror(res));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free the interim conversion result.
|
* Free the interim conversion result.
|
||||||
|
Reference in New Issue
Block a user