Skip to content

Commit

Permalink
if detection results in ascii, then default to utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalsh committed Jun 4, 2015
1 parent d79af50 commit 1e8831a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions goodtables/datatable/datatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ def _detect_stream_encoding(self, stream):
stream.seek(0)

encoding = chardet.detect(sample)['encoding']
# default to utf-8 for safety
if encoding == 'ascii':
encoding = 'utf-8'

return encoding

Expand Down

0 comments on commit 1e8831a

Please sign in to comment.