diff --git a/sarc/sarc.py b/sarc/sarc.py index 759cf14..8f194f9 100644 --- a/sarc/sarc.py +++ b/sarc/sarc.py @@ -345,7 +345,7 @@ def get_file_offsets(self) -> typing.List[typing.Tuple[str, int]]: offsets.append((self._files[h].name, data_offset)) data_offset += len(self._files[h].data) return offsets - + def get_bytes(self): stream = io.BytesIO() self.write(stream) @@ -388,7 +388,7 @@ def write(self, stream: typing.BinaryIO) -> int: stream.write(self._u32(data_offset)) data_offset += len(self._files[h].data) stream.write(self._u32(data_offset)) - string_offset += _align_up(len(self._files[h].name) + 1, 4) + string_offset += _align_up(len(self._files[h].name.encode()) + 1, 4) # File name table stream.write(b'SFNT')