def get_part_charset(self, headers):
    content_type = headers.get('content-type')
    if content_type:
        (mimetype, ct_params) = parse_options_header(content_type)
        return ct_params.get('charset', self.charset)
    return self.charset
def get_part_charset(self, headers):
    content_type = headers.get('content-type')
    if content_type:
        (mimetype, ct_params) = parse_options_header(content_type)
        return ct_params.get('charset', self.charset)
    return self.charset