Let fb2fth.py replace zero bytes in block files with a ^@ sequence.

Zero bytes in text files can't be handled by at least some editors.
This commit is contained in:
Philip Zembrod 2022-01-11 23:34:29 +01:00
parent 6616904fbb
commit 16857ea57a
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ def readToString(inFile):
while(offset < len(block)):
# sys.stderr.write("block %d offset %d\n" % (blockNo, offset))
line = block[offset:offset+64].decode(encoding="cp437")
result.append(line.rstrip())
result.append(line.rstrip().replace('\0', '^@'))
offset += 64
blockNo += 1
return result