Skip to content

Commit

Permalink
Merge pull request #1 from MrMindy/encoding
Browse files Browse the repository at this point in the history
Add enconding parameter on "open" function
  • Loading branch information
omkar-foss authored Sep 22, 2020
2 parents ff755c3 + b81cd1f commit e5788e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion emosent/emosent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def _build_dict_from_csv(csv_path):

emoji_sentiment_rankings = {}

with open(csv_path, newline='') as csv_file:
# MrMindy:
# Adding the encoding. At least on Windows, I tested it before, the terminal displays an error that implies
# with the charset. Adding the UTF-8, everything runs smoothly.

with open(csv_path, newline='', encoding='utf-8') as csv_file:
csv_reader = csv.reader(csv_file)
_header_row = next(csv_reader)
for row in csv_reader:
Expand Down

0 comments on commit e5788e7

Please sign in to comment.