Skip to content

Commit

Permalink
Fix null byte detokenization
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Jan 3, 2024
1 parent e9f9176 commit 5f6bf80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tivars/tokenizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def decode(bytestream: bytes, *,
else:
raise ValueError(f"unrecognized bytes '0x{curr_bytes[0]:x}{curr_bytes[1]:x}' at position {index}")

else:
curr_bytes = b''

index += 1

return b''.join(out) if mode == "ti_ascii" else "".join(out), since
Expand Down

0 comments on commit 5f6bf80

Please sign in to comment.