diff --git a/xbin.py b/xbin.py index a061262..38ea600 100644 --- a/xbin.py +++ b/xbin.py @@ -323,8 +323,9 @@ def WriteMetaVec4Block(file, _hash, vec): @staticmethod def WriteCommentBlock(file, comment): - comment = bytearray(comment.encode('utf-8')) - data = struct.pack('Hxx%ds' % (len(comment) + 1), 0xC355, comment) + comment = __str_packable__(comment) + padded_size = padded(len(comment) + 1) + data = struct.pack('Hxx%ds' % padded_size, 0xC355, comment) file.write(data) @staticmethod