DEL (0x7f) character needs to be escaped (not printable) in output
This commit is contained in:
parent
d0e617e846
commit
4b228e007f
@ -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\"",
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user