diff --git a/lib/dnsbox-base/src/records/powerdns_tests.rs b/lib/dnsbox-base/src/records/powerdns_tests.rs index eea65fd..ba12d06 100644 --- a/lib/dnsbox-base/src/records/powerdns_tests.rs +++ b/lib/dnsbox-base/src/records/powerdns_tests.rs @@ -304,6 +304,12 @@ fn test_TXT() { None, b"\x0e\xc3\x85LAND ISLANDS", ); + check( + types::TXT, + "\"text with DEL in there: \\127\"", + None, + b"\x19text with DEL in there: \x7f", + ); check( types::TXT, "\"\u{00c5}LAND ISLANDS\"", diff --git a/lib/dnsbox-base/src/ser/text/quoted.rs b/lib/dnsbox-base/src/ser/text/quoted.rs index 761b86f..f8ea5a1 100644 --- a/lib/dnsbox-base/src/ser/text/quoted.rs +++ b/lib/dnsbox-base/src/ser/text/quoted.rs @@ -43,7 +43,7 @@ impl<'a> Iterator for EncodeIterator<'a> { } let b = self.data[0]; self.data = &self.data[1..]; - if b < 32 || b > 127 || (self.encode_whitespace && is_ascii_whitespace(b)) { + if b < 32 || b >= 127 || (self.encode_whitespace && is_ascii_whitespace(b)) { // `\ddd` let d1 = b / 100; let d2 = (b / 10) % 10;