Add Chinese support

This commit is contained in:
WeijiangChen 2019-08-07 21:15:14 +08:00
parent 1db55caba8
commit c97f704d01

View File

@ -254,7 +254,8 @@ class MagicEncode(object):
return return
if re.findall(r'[\u4e00-\u9fa5]', text): if re.findall(r'[\u4e00-\u9fa5]', text):
text = text.encode('GB18030') self.driver._raw(text.encode('GB18030'))
return
# See how far we can go into the text with the current encoding # See how far we can go into the text with the current encoding
to_write, text = split_writable_text(self.encoder, text, self.encoding) to_write, text = split_writable_text(self.encoder, text, self.encoding)