Skip to content

Commit

Permalink
Fix unicode decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
gotlaufs committed Dec 5, 2017
1 parent c7c2648 commit 2e3e9ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RASPBERRY/twitter_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import logging
import re
import unicodedata
import unidecode
import twitter


Expand Down Expand Up @@ -53,7 +53,7 @@ def get_messages_clean(self):
text = text.lstrip()
text = text.rstrip()
# Convert characters to ASCII
text = unicodedata.normalize('NFKD', text)
text = unidecode.unidecode(text)
# text = unicodedata.normalize('NFKD', text).encode('ascii', 'ignore')

sl[i]["Text"] = text
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ Dependencies (get all of them through pip3):
- picamera
- pyserial
- python-twitter
- tinydb
- unidecode

0 comments on commit 2e3e9ac

Please sign in to comment.