Skip to content
Snippets Groups Projects
Unverified Commit 8f293180 authored by slateny's avatar slateny Committed by GitHub
Browse files

gh-77630: Change Charset to charset (GH-92439)

parent 5ed5c561
Branches
Tags
No related merge requests found
...@@ -58,9 +58,9 @@ Import this class from the :mod:`email.charset` module. ...@@ -58,9 +58,9 @@ Import this class from the :mod:`email.charset` module.
.. attribute:: header_encoding .. attribute:: header_encoding
If the character set must be encoded before it can be used in an email If the character set must be encoded before it can be used in an email
header, this attribute will be set to ``Charset.QP`` (for header, this attribute will be set to ``charset.QP`` (for
quoted-printable), ``Charset.BASE64`` (for base64 encoding), or quoted-printable), ``charset.BASE64`` (for base64 encoding), or
``Charset.SHORTEST`` for the shortest of QP or BASE64 encoding. Otherwise, ``charset.SHORTEST`` for the shortest of QP or BASE64 encoding. Otherwise,
it will be ``None``. it will be ``None``.
...@@ -68,7 +68,7 @@ Import this class from the :mod:`email.charset` module. ...@@ -68,7 +68,7 @@ Import this class from the :mod:`email.charset` module.
Same as *header_encoding*, but describes the encoding for the mail Same as *header_encoding*, but describes the encoding for the mail
message's body, which indeed may be different than the header encoding. message's body, which indeed may be different than the header encoding.
``Charset.SHORTEST`` is not allowed for *body_encoding*. ``charset.SHORTEST`` is not allowed for *body_encoding*.
.. attribute:: output_charset .. attribute:: output_charset
...@@ -175,9 +175,9 @@ new entries to the global character set, alias, and codec registries: ...@@ -175,9 +175,9 @@ new entries to the global character set, alias, and codec registries:
*charset* is the input character set, and must be the canonical name of a *charset* is the input character set, and must be the canonical name of a
character set. character set.
Optional *header_enc* and *body_enc* is either ``Charset.QP`` for Optional *header_enc* and *body_enc* is either ``charset.QP`` for
quoted-printable, ``Charset.BASE64`` for base64 encoding, quoted-printable, ``charset.BASE64`` for base64 encoding,
``Charset.SHORTEST`` for the shortest of quoted-printable or base64 encoding, ``charset.SHORTEST`` for the shortest of quoted-printable or base64 encoding,
or ``None`` for no encoding. ``SHORTEST`` is only valid for or ``None`` for no encoding. ``SHORTEST`` is only valid for
*header_enc*. The default is ``None`` for no encoding. *header_enc*. The default is ``None`` for no encoding.
......
...@@ -112,8 +112,8 @@ def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): ...@@ -112,8 +112,8 @@ def add_charset(charset, header_enc=None, body_enc=None, output_charset=None):
charset is the input character set, and must be the canonical name of a charset is the input character set, and must be the canonical name of a
character set. character set.
Optional header_enc and body_enc is either Charset.QP for Optional header_enc and body_enc is either charset.QP for
quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for quoted-printable, charset.BASE64 for base64 encoding, charset.SHORTEST for
the shortest of qp or base64 encoding, or None for no encoding. SHORTEST the shortest of qp or base64 encoding, or None for no encoding. SHORTEST
is only valid for header_enc. It describes how message headers and is only valid for header_enc. It describes how message headers and
message bodies in the input charset are to be encoded. Default is no message bodies in the input charset are to be encoded. Default is no
...@@ -185,13 +185,13 @@ class Charset: ...@@ -185,13 +185,13 @@ class Charset:
header_encoding: If the character set must be encoded before it can be header_encoding: If the character set must be encoded before it can be
used in an email header, this attribute will be set to used in an email header, this attribute will be set to
Charset.QP (for quoted-printable), Charset.BASE64 (for charset.QP (for quoted-printable), charset.BASE64 (for
base64 encoding), or Charset.SHORTEST for the shortest of base64 encoding), or charset.SHORTEST for the shortest of
QP or BASE64 encoding. Otherwise, it will be None. QP or BASE64 encoding. Otherwise, it will be None.
body_encoding: Same as header_encoding, but describes the encoding for the body_encoding: Same as header_encoding, but describes the encoding for the
mail message's body, which indeed may be different than the mail message's body, which indeed may be different than the
header encoding. Charset.SHORTEST is not allowed for header encoding. charset.SHORTEST is not allowed for
body_encoding. body_encoding.
output_charset: Some character sets must be converted before they can be output_charset: Some character sets must be converted before they can be
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment