mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 21:24:57 +02:00
...
This commit is contained in:
parent
f733b10876
commit
7bf24395a8
1 changed files with 1 additions and 1 deletions
|
|
@ -141,10 +141,10 @@ def write_unicode_text(self, text, ignore_errors=False):
|
|||
if self.is_console:
|
||||
from ctypes import wintypes, byref, c_wchar_p
|
||||
written = wintypes.DWORD(0)
|
||||
text = text.replace('\0', '')
|
||||
chunk = len(text)
|
||||
while text:
|
||||
t, text = text[:chunk], text[chunk:]
|
||||
t = t.partition('\0')[0]
|
||||
wt = c_wchar_p(t)
|
||||
if not self.write_console(self.file_handle, wt, len(t), byref(written), None):
|
||||
# Older versions of windows can fail to write large strings
|
||||
|
|
|
|||
Loading…
Reference in a new issue