From 262f23031abe122890dcd4e05d87ad8fc2079ff4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 2 Jan 2022 12:13:04 +0200 Subject: [PATCH] Produce an octal escape code for \177 This character is designated DEL and should be considered non-printable. --- source/strings/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/strings/utils.cpp b/source/strings/utils.cpp index eb2142d..748d717 100644 --- a/source/strings/utils.cpp +++ b/source/strings/utils.cpp @@ -258,7 +258,7 @@ string c_escape(const string &str, bool escape_8bit) result += "\\\'"; else if(c=='\\') result += "\\\\"; - else if(static_cast(c)<' ' || (escape_8bit && (c&0x80))) + else if(static_cast(c)<' ' || c==0x7F || (escape_8bit && (c&0x80))) { char buf[4] = { '\\', 0 }; for(unsigned j=0; j<3; ++j) -- 2.43.0