Drop NON_PRINTABLE_CHAR - change to GDB way
I've suggested to use ^
for nonprintable characters before - but in retrospective must say it is better to stay with thte GDB way (one of the reasons are GDB frontends).
So instead of ^
(used one time with the NON_PRINTABLE_CHAR constants, otherwise directly) we should use GDB's escaping, which can be created with "\\" + oct(byte).zfill(5)[2:]
(for whatever reason [2:].zfill(3)
does not work correctly)
This has the benefit that one can distinguish nonprintable characters, while keeping the extension to not break because of encoding issues. Only thing to watch out: `\001´ must be counted as one element for the code.
It also has the benefit that GDB frontend may be able to actually show those characters when they aren't printable because of encoding issues.