Skip to content

Commit

Permalink
Catch明确的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudaice committed May 10, 2013
1 parent 65d07d2 commit 9b0f60d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jieba/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def cut(sentence,cut_all=False):
if not isinstance(sentence, unicode):
try:
sentence = sentence.decode('utf-8')
except:
except UnicodeDecodeError:
sentence = sentence.decode('gbk','ignore')
re_han, re_skip = re.compile(ur"([\u4E00-\u9FA5a-zA-Z0-9+#&\._]+)"), re.compile(ur"(\s+)")
if cut_all:
Expand Down

0 comments on commit 9b0f60d

Please sign in to comment.