Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions agithub/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,13 @@ def parseContentType(self, ctype):
self.ctypeParameters = {}

if 'charset' not in self.ctypeParameters:
self.ctypeParameters['charset'] = 'ISO-8859-1'
# NB: INO-8859-1 is specified (RFC 2068) as the default
# charset in case none is provided
if ctype == 'application/json':
self.ctypeParameters['charset'] = 'utf8'
# RFC 4627 says JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.
else:
self.ctypeParameters['charset'] = 'ISO-8859-1'
# NB: INO-8859-1 is specified (RFC 2068) as the default
# charset in case none is provided

def mangled_mtype(self):
"""
Expand Down