Skip to content

Commit

Permalink
Merge pull request liuwons#168 from archspider/master
Browse files Browse the repository at this point in the history
修复无法转换'\xa0'‘字符问题
  • Loading branch information
liuwons authored Dec 29, 2016
2 parents c9c84a1 + 8712318 commit bb76cc7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def tuling_auto_reply(self, uid, msg):
result = ''
if respond['code'] == 100000:
result = respond['text'].replace('<br>', ' ')
result = result.replace(u'\xa0', u' ')
elif respond['code'] == 200000:
result = respond['url']
elif respond['code'] == 302000:
Expand All @@ -39,6 +40,7 @@ def tuling_auto_reply(self, uid, msg):
k['article'] + "\t" + k['detailurl'] + "\n"
else:
result = respond['text'].replace('<br>', ' ')
result = result.replace(u'\xa0', u' ')

print ' ROBOT:', result
return result
Expand Down

0 comments on commit bb76cc7

Please sign in to comment.