call the method self.replace_header with argument string 'Content-Type', 'text/%s; charset="%s"', where '%s' symbols are replaced by:
self . replace_header ( 'Content-Type' , 'text/%s; charset="%s"' % ( subtype , charset ) )