Commit b738041c authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Rework previous fix slightly; the &0x20 test seems useless, and the isprint()...

Rework previous fix slightly; the &0x20 test seems useless, and the isprint() check mustn't prevent the meta-bit check at the end
parent e8792c1f
......@@ -87,13 +87,11 @@ def alt(c):
return _ctoi(c) | 0x80
def unctrl(c):
if isprint(c):
return chr(_ctoi(c))
bits = _ctoi(c)
if bits == 0x7f:
rep = "^?"
elif bits & 0x20:
rep = chr((bits & 0x7f) | 0x20)
elif isprint(bits & 0x7f):
rep = chr(bits & 0x7f)
else:
rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20)
if bits & 0x80:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment