Skip to content

Commit

Permalink
Change encoding to UTF-8
Browse files Browse the repository at this point in the history
Addressing adein#15, changing the open to UTF-8 encoding to allow for basic emoji characters (and other characters).

I believe adein#15 only effected Windows users (as the `open` command would default to using `cp1215` encoding instead of `utf-8`), but the addition of the encoding generally makes the code more robust IMO.
  • Loading branch information
jrwrigh authored Aug 10, 2018
1 parent 4dabcb4 commit 5812796
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hangouts_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def parse_input_file(self, hangouts_file_name, user_phone_number):
"""
conversations = []
self_gaia_id = None # gaia_id for the phone owner
with open(hangouts_file_name, 'rt') as data_file:
with open(hangouts_file_name, 'rt', encoding='utf-8') as data_file:
# Read the Hangouts JSON file and turn into objects
data = json.load(data_file, object_hook=lambda d: Namespace(**d))
# Iterate through each conversation in the listi
Expand Down

0 comments on commit 5812796

Please sign in to comment.