mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
...
This commit is contained in:
parent
f733b10876
commit
7bf24395a8
@ -141,10 +141,10 @@ class Detect(object):
|
|||||||
if self.is_console:
|
if self.is_console:
|
||||||
from ctypes import wintypes, byref, c_wchar_p
|
from ctypes import wintypes, byref, c_wchar_p
|
||||||
written = wintypes.DWORD(0)
|
written = wintypes.DWORD(0)
|
||||||
|
text = text.replace('\0', '')
|
||||||
chunk = len(text)
|
chunk = len(text)
|
||||||
while text:
|
while text:
|
||||||
t, text = text[:chunk], text[chunk:]
|
t, text = text[:chunk], text[chunk:]
|
||||||
t = t.partition('\0')[0]
|
|
||||||
wt = c_wchar_p(t)
|
wt = c_wchar_p(t)
|
||||||
if not self.write_console(self.file_handle, wt, len(t), byref(written), None):
|
if not self.write_console(self.file_handle, wt, len(t), byref(written), None):
|
||||||
# Older versions of windows can fail to write large strings
|
# Older versions of windows can fail to write large strings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user