MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / decode_header

Function decode_header

tools/python-3.11.9-amd64/Lib/nntplib.py:170–179  ·  view source on GitHub ↗

Takes a unicode string representing a munged header value and decodes it as a (possibly non-ASCII) readable value.

(header_str)

Source from the content-addressed store, hash-verified

168
169# Helper function(s)
170def decode_header(header_str):
171 """Takes a unicode string representing a munged header value
172 and decodes it as a (possibly non-ASCII) readable value."""
173 parts = []
174 for v, enc in _email_decode_header(header_str):
175 if isinstance(v, bytes):
176 parts.append(v.decode(enc or 'ascii'))
177 else:
178 parts.append(v)
179 return ''.join(parts)
180
181def _parse_overview_fmt(lines):
182 """Parse a list of string representing the response to LIST OVERVIEW.FMT

Callers 1

nntplib.pyFile · 0.70

Calls 3

appendMethod · 0.45
decodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected