mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
palmdoc: consistently use bytes when writing to the buffer
This commit is contained in:
parent
e02f836bd0
commit
0b252e8659
@ -83,7 +83,7 @@ def py_compress_doc(data):
|
|||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
if och == 0 or (och > 8 and och < 0x80):
|
if och == 0 or (och > 8 and och < 0x80):
|
||||||
out.write(ch)
|
out.write(ch.encode('utf-8'))
|
||||||
else:
|
else:
|
||||||
j = i
|
j = i
|
||||||
binseq = [ch]
|
binseq = [ch]
|
||||||
@ -95,6 +95,6 @@ def py_compress_doc(data):
|
|||||||
binseq.append(ch)
|
binseq.append(ch)
|
||||||
j += 1
|
j += 1
|
||||||
out.write(pack('>B', len(binseq)))
|
out.write(pack('>B', len(binseq)))
|
||||||
out.write(''.join(binseq))
|
out.write(''.join(binseq).encode('utf-8'))
|
||||||
i += len(binseq) - 1
|
i += len(binseq) - 1
|
||||||
return out.getvalue()
|
return out.getvalue()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user