Permalink
Browse files

Deal with parity in fixup script.

  • Loading branch information...
ali1234 committed Aug 19, 2011
1 parent 149b86d commit e49682254c1efc2fc1acdfa8e22efa603f17e372
Showing with 5 additions and 2 deletions.
  1. +5 −2 fixup.py
View
@@ -20,8 +20,11 @@
while True:
packet = [x for x in sys.stdin.read(42)]
for i in range(1,42):
- if packet[i] == 'N' and packet[i-1].islower():
- packet[i] = '.'
+ a = chr(ord(packet[i-1])&0x7f)
+ b = chr(ord(packet[i])&0x7f)
+ if b == 'N' and a.islower():
+ packet[i] = chr(ord('.')|0x80)
+
sys.stdout.write("".join(packet))
sys.stdout.flush()

0 comments on commit e496822

Please sign in to comment.