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

Method get_body_encoding

Lib/email/charset.py:245–264  ·  view source on GitHub ↗

Return the content-transfer-encoding used for body encoding. This is either the string 'quoted-printable' or 'base64' depending on the encoding used, or it is a function in which case you should call the function with a single argument, the Message object being encod

(self)

Source from the content-addressed store, hash-verified

243 return str(self) == str(other).lower()
244
245 def get_body_encoding(self):
246 """Return the content-transfer-encoding used for body encoding.
247
248 This is either the string 'quoted-printable' or 'base64' depending on
249 the encoding used, or it is a function in which case you should call
250 the function with a single argument, the Message object being
251 encoded. The function should then set the Content-Transfer-Encoding
252 header itself to whatever is appropriate.
253
254 Returns "quoted-printable" if self.body_encoding is QP.
255 Returns "base64" if self.body_encoding is BASE64.
256 Returns conversion function otherwise.
257 """
258 assert self.body_encoding != SHORTEST
259 if self.body_encoding == QP:
260 return 'quoted-printable'
261 elif self.body_encoding == BASE64:
262 return 'base64'
263 else:
264 return encode_7or8bit
265
266 def get_output_charset(self):
267 """Return the output character set.

Calls

no outgoing calls