(header_str)
return ' '.join(parts)
Takes an unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value.
Takes an unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value.
Takes an unicode string representing a munged header value and decodes it as a ( possibly non - ASCII ) readable value .
def decode_header(header_str):
    """Takes an unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value."""
    parts = []
    for v, enc in _email_decode_header(header_str):
        if isinstance(v, bytes):
            parts.append(v.decode(enc or 'ascii'))
        else:
            parts.append(v)
    return ' '.join(parts)
def decode_header ( header_str ) : parts = [ ] for v , enc in _email_decode_header ( header_str ) : if isinstance ( v , bytes ) : parts . append ( v . decode ( enc or 'ascii' ) ) else : parts . append ( v ) return ' ' . join ( parts )