From af8682247961750be422a173c3307a2301e1c90c Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Sun, 3 Apr 2016 02:24:13 +0800 Subject: [PATCH] add somtehing --- __main__.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/__main__.py b/__main__.py index 9fed7bd..cd349f4 100755 --- a/__main__.py +++ b/__main__.py @@ -121,12 +121,7 @@ class MainWindow(QtGui.QMainWindow, ui.Ui_MainWindow): def input_characters(self): import re characters = self.lineEdit.text() - - #some CJK ext B,C,etc arerepensented in utf16 in pyqt qlineedit. - #convert it to utf8 - #characters = characters.encode(encoding='utf-16',errors='surrogatepass').decode('utf-8') - #print('\\u'+"\\u".join("{:x}".format(ord(c)) for c in characters)) - chinese_char_pattern = re.compile("^[一-鿌㐀-䶵𠀷𠂁𠁍]+$",re.UNICODE) + chinese_char_pattern = re.compile(u"^([一-鿌㐀-䶵\U00020000-\U0002A6D6])+$",re.UNICODE) is_chinese_chars = chinese_char_pattern.match(characters) if is_chinese_chars: