Oihana PHP Enums

ContentTransferEncoding uses ConstantsTrait

MIME `Content-Transfer-Encoding` values (RFC 2045 §6).

Declares how the body of a part was encoded for transport:

  • 7bit, 8bit, binary are identity encodings — the data is left as-is (only line-length / byte-range guarantees differ).
  • quoted-printable and base64 actually transform the bytes and must be decoded before use.
Tags
author

Marc Alcaraz

since
1.2.0
see
MailHeader::CONTENT_TRANSFER_ENCODING

Table of Contents

Constants

BASE64  : string = 'base64'
`base64` — Binary-safe base64 encoding.
BINARY  : string = 'binary'
`binary` — Arbitrary bytes with no line-length restriction.
EIGHT_BIT  : string = '8bit'
`8bit` — 8-bit data, lines ≤ 998 octets.
QUOTED_PRINTABLE  : string = 'quoted-printable'
`quoted-printable` — Mostly-ASCII text with `=XX` escapes.
SEVEN_BIT  : string = '7bit'
`7bit` — US-ASCII, lines ≤ 998 octets. The default when absent.

Methods

isIdentity()  : bool
Whether the encoding leaves the data unchanged (`7bit` / `8bit` / `binary`) and therefore needs no decoding step.

Constants

BINARY

`binary` — Arbitrary bytes with no line-length restriction.

public string BINARY = 'binary'

QUOTED_PRINTABLE

`quoted-printable` — Mostly-ASCII text with `=XX` escapes.

public string QUOTED_PRINTABLE = 'quoted-printable'

SEVEN_BIT

`7bit` — US-ASCII, lines ≤ 998 octets. The default when absent.

public string SEVEN_BIT = '7bit'

Methods

isIdentity()

Whether the encoding leaves the data unchanged (`7bit` / `8bit` / `binary`) and therefore needs no decoding step.

public static isIdentity(string $encoding) : bool
Parameters
$encoding : string

One of the class constants (case-insensitive).

Return values
bool

True for an identity encoding, false for quoted-printable / base64.

On this page

Search results