Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Encoding Constructor (Int32, EncoderFallback^, DecoderFallback^)

.NET Framework (current version)
 

Initializes a new instance of the Encoding class that corresponds to the specified code page with the specified encoder and decoder fallback strategies.

Namespace:   System.Text
Assembly:  mscorlib (in mscorlib.dll)

protected:
Encoding(
	int codePage,
	EncoderFallback^ encoderFallback,
	DecoderFallback^ decoderFallback
)

Parameters

codePage
Type: System::Int32

The encoding code page identifier.

encoderFallback
Type: System.Text::EncoderFallback^

An object that provides an error-handling procedure when a character cannot be encoded with the current encoding.

decoderFallback
Type: System.Text::DecoderFallback^

An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding.

Exception Condition
ArgumentOutOfRangeException

codePage is less than zero.

This constructor is protected; derived classes override it.

You call this constructor from a derived class to control the fallback encoding and decoding strategies. The Encoding class constructors create read-only encoding objects that don't allow encoder or decoder fallback to be set after the object is created.

If either encoderFallback or decoderFallback is null, best-fit fallback is used as the corresponding fallback strategy.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top
Show: