Table of Contents

QuotedPrintableEncodingOptions Struct

Definition

Namespace
Bodu.Text.Encoding
Assembly
Bodu.Text.Encoding.dll
Package
Bodu.Text.Encoding 1.0.0
Source
QuotedPrintableEncodingOptions.cs

Configures how QuotedPrintable produces Quoted-Printable output: the line-break treatment, the soft line-wrap column, and the newline sequence.

public readonly struct QuotedPrintableEncodingOptions : IEquatable<QuotedPrintableEncodingOptions>
Implements
Inherited Members
Extension Methods

Remarks

default(QuotedPrintableEncodingOptions) behaves as Binary with a 76-character line limit and a CRLF newline: a zero MaxLineLength is normalized to 76 and a null NewLine to "\r\n". A zero line length therefore means the RFC default, not unlimited output.

Constructors

QuotedPrintableEncodingOptions(QuotedPrintableEncodingMode, int, string?)

Initializes a new instance of the QuotedPrintableEncodingOptions struct.

public QuotedPrintableEncodingOptions(QuotedPrintableEncodingMode mode = QuotedPrintableEncodingMode.Binary, int maxLineLength = 76, string? newLine = null)

Parameters

mode QuotedPrintableEncodingMode

The line-break treatment.

maxLineLength int

The maximum encoded line length, excluding the newline delimiter.

newLine string

The newline sequence, or null for CRLF.

Properties

Default

Gets the default options: Binary, a 76-character line limit, and a CRLF newline.

public static QuotedPrintableEncodingOptions Default { get; }

Property Value

QuotedPrintableEncodingOptions

The default Quoted-Printable encoding options.

MaxLineLength

Gets the maximum number of characters per encoded line, excluding the trailing newline delimiter.

public int MaxLineLength { get; init; }

Property Value

int

The line length, where 0 selects the RFC default of 76.

Mode

Gets the line-break treatment applied to the source.

public QuotedPrintableEncodingMode Mode { get; init; }

Property Value

QuotedPrintableEncodingMode

The encoding mode.

NewLine

Gets the newline sequence inserted for soft and hard line breaks.

public string? NewLine { get; init; }

Property Value

string

The newline string, or null to select CRLF.

Remarks

Only "\r\n" and "\n" are accepted. CRLF is the MIME canonical line ending; "\n" is a non-canonical convenience profile for local text processing and should not be used for MIME transport. Output using "\n" round-trips only when decoded with AllowBareLineFeed.

Text

Gets canonical MIME text options: Text, a 76-character line limit, and a CRLF newline.

public static QuotedPrintableEncodingOptions Text { get; }

Property Value

QuotedPrintableEncodingOptions

The canonical MIME text encoding options.

Methods

Equals(QuotedPrintableEncodingOptions)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(QuotedPrintableEncodingOptions other)

Parameters

other QuotedPrintableEncodingOptions

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(QuotedPrintableEncodingOptions, QuotedPrintableEncodingOptions)

public static bool operator ==(QuotedPrintableEncodingOptions left, QuotedPrintableEncodingOptions right)

Parameters

left QuotedPrintableEncodingOptions
right QuotedPrintableEncodingOptions

Returns

bool

operator !=(QuotedPrintableEncodingOptions, QuotedPrintableEncodingOptions)

public static bool operator !=(QuotedPrintableEncodingOptions left, QuotedPrintableEncodingOptions right)

Parameters

left QuotedPrintableEncodingOptions
right QuotedPrintableEncodingOptions

Returns

bool

Applies to

ProductVersions
.NET8, 10