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

Method _get_encoder

tools/python-3.11.9-amd64/Lib/email/charset.py:355–368  ·  view source on GitHub ↗
(self, header_bytes)

Source from the content-addressed store, hash-verified

353 return lines
354
355 def _get_encoder(self, header_bytes):
356 if self.header_encoding == BASE64:
357 return email.base64mime
358 elif self.header_encoding == QP:
359 return email.quoprimime
360 elif self.header_encoding == SHORTEST:
361 len64 = email.base64mime.header_length(header_bytes)
362 lenqp = email.quoprimime.header_length(header_bytes)
363 if len64 < lenqp:
364 return email.base64mime
365 else:
366 return email.quoprimime
367 else:
368 return None
369
370 def body_encode(self, string):
371 """Body-encode a string by converting it first to bytes.

Callers 2

header_encodeMethod · 0.95
header_encode_linesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected