mirror of
https://github.com/forth-ev/VolksForth.git
synced 2024-05-29 02:41:32 +00:00
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:
parent
6616904fbb
commit
16857ea57a
|
@ -15,7 +15,7 @@ def readToString(inFile):
|
||||||
while(offset < len(block)):
|
while(offset < len(block)):
|
||||||
# sys.stderr.write("block %d offset %d\n" % (blockNo, offset))
|
# sys.stderr.write("block %d offset %d\n" % (blockNo, offset))
|
||||||
line = block[offset:offset+64].decode(encoding="cp437")
|
line = block[offset:offset+64].decode(encoding="cp437")
|
||||||
result.append(line.rstrip())
|
result.append(line.rstrip().replace('\0', '^@'))
|
||||||
offset += 64
|
offset += 64
|
||||||
blockNo += 1
|
blockNo += 1
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue
Block a user