if (optlen != 0) {
int i;
+ bool utf8ok = false;
ADD_STRING(target, " ");
optdata = isc_buffer_current(&optbuf);
- if (optcode != DNS_OPT_EDE) {
+ if (optcode == DNS_OPT_EDE) {
+ utf8ok = isc_utf8_valid(optdata,
+ optlen);
+ }
+ if (!utf8ok) {
for (i = 0; i < optlen; i++) {
const char *sep;
switch (optcode) {
if (isprint(optdata[i])) {
isc_buffer_putmem(
target, &optdata[i], 1);
+ } else if (utf8ok && optdata[i] > 127) {
+ isc_buffer_putmem(
+ target, &optdata[i], 1);
} else {
isc_buffer_putstr(target, ".");
}