Add Chinese support (#356)
* Add Chinese support
* Add author
* Add newline
* Revert "Add Chinese support"
This reverts commit 110200dde6
.
* Add Chinese support
* Add Chinese support
* update mailmap file
* update formatting
---------
Co-authored-by: Patrick Kanzler <dev@pkanzler.de>
Co-authored-by: Patrick Kanzler <4189642+patkan@users.noreply.github.com>
This commit is contained in:
parent
25867f3196
commit
6849dd3979
1
.mailmap
1
.mailmap
|
@ -13,6 +13,7 @@ csoft2k <csoft2k@hotmail.com>
|
|||
Sergio Pulgarin <sergio.pulgarin@gmail.com>
|
||||
reck31 <rakesh.gunduka@gmail.com>
|
||||
Alex Debiasio <alex.debiasio@thinkin.io> <alex.debiasio@studenti.unitn.it>
|
||||
白月秋见心 <ourweijiang@gmail.com>
|
||||
Maximilian Wagenbach <maximilian.wagenbach@native-instruments.de>
|
||||
<belono@users.noreply.github.com> <tiotil.lindeman@gmail.com>
|
||||
belono <belono@users.noreply.github.com> Benito López <belono@users.noreply.github.com>
|
||||
|
|
1
AUTHORS
1
AUTHORS
|
@ -41,3 +41,4 @@ Thijs Triemstra
|
|||
Thomas van den Berg
|
||||
Yaisel Hurtado
|
||||
ysuolmai
|
||||
白月秋见心
|
||||
|
|
|
@ -18,6 +18,7 @@ from .constants import CODEPAGE_CHANGE
|
|||
from .exceptions import Error
|
||||
from .codepages import CodePages
|
||||
import six
|
||||
import re
|
||||
|
||||
|
||||
class Encoder(object):
|
||||
|
@ -252,6 +253,10 @@ class MagicEncode(object):
|
|||
self.write_with_encoding(self.encoding, text)
|
||||
return
|
||||
|
||||
if re.findall(r"[\u4e00-\u9fa5]", text):
|
||||
self.driver._raw(text.encode("GB18030"))
|
||||
return
|
||||
|
||||
# See how far we can go into the text with the current encoding
|
||||
to_write, text = split_writable_text(self.encoder, text, self.encoding)
|
||||
if to_write:
|
||||
|
|
Loading…
Reference in New Issue