Skip to content

Commit

Permalink
bugfix: content can be unicode sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
binux committed Mar 6, 2014
1 parent c3d6f72 commit 0f25a36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def encoding(self):
if hasattr(self, '_encoding'):
return self._encoding

# content is unicode
if isinstance(self.content, unicode):
return 'unicode'

# Try charset from content-type
encoding = get_encoding_from_headers(self.headers)
if encoding == 'ISO-8859-1':
Expand Down

0 comments on commit 0f25a36

Please sign in to comment.