Partialy revert r4366516
Partialy revert r4366516
([arc::pullid] 33aac682-e37ef8c7-a4f1bf20-9d2360b)
@@ -50,7 +50,7 @@ def escape_special_symbols(strval):
if c in ("\\", "\""):
retval += "\\" + c
elif ord(c) < ord(' '):
- retval += (c if isinstance(c, str) else c.decode()).encode('unicode_escape').decode()
+ retval += c.encode("string_escape")
else:
retval += c
return retval
