MCPcopy Index your code
hub / github.com/python/cpython / header_decode

Function header_decode

Lib/email/quoprimime.py:292–300  ·  view source on GitHub ↗

Decode a string encoded with RFC 2045 MIME header 'Q' encoding. This function does not parse a full MIME header value encoded with quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use the high level email.header class for that functionality.

(s)

Source from the content-addressed store, hash-verified

290
291# Header decoding is done a bit differently
292def header_decode(s):
293 """Decode a string encoded with RFC 2045 MIME header 'Q' encoding.
294
295 This function does not parse a full MIME header value encoded with
296 quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use
297 the high level email.header class for that functionality.
298 """
299 s = s.replace('_', ' ')
300 return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII)

Callers

nothing calls this directly

Calls 2

replaceMethod · 0.45
subMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…