#NEWLINE# def content_type_to_charset( content_type ) : #NEWLINE# #INDENT# "Return charset part of content-type header.\n\n    >>> from django_downloadview.utils import content_type_to_charset\n    >>> content_type_to_charset('text/html; charset=utf-8')\n    'utf-8'\n\n    " #NEWLINE# match = re . search ( charset_pattern , content_type ) #NEWLINE# if match : #NEWLINE# #INDENT# return match . group ( 'charset' )