System.IO.TextWriter.Encoding Property

When overridden in a derived class, returns the character encoding in which the output is written.

Syntax

public abstract System.Text.Encoding Encoding { get; }

Value

The System.Text.Encoding in which the output is written.

Remarks

This property is necessary for some XML scenarios where a header must be written containing the encoding used by the TextWriter. This enables the XML code to consume an arbitrary TextWriter and generate the correct XML header.

For a list of common I/O tasks, see Common I/O Tasks.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0