Windows apps
Collapse the table of content
Expand the table of content

CodePagesEncodingProvider::Instance Property

.NET Framework (current version)

Gets an encoding provider for code pages supported in the desktop .NET Framework but not in the current .NET Framework platform.

Namespace:  System.Text
Assembly:  System.Text.Encoding.CodePages (in System.Text.Encoding.CodePages.dll)

public:
static property EncodingProvider^ Instance {
	EncodingProvider^ get ();
}

Property Value

Type: System.Text::EncodingProvider
An encoding provider that allows access to encodings not supported in .NET Framework 4.6.

The Instance property returns an EncodingProvider object that makes encodings available to .NET Framework 4.6 apps that otherwise are available only in the .NET Framework on the Windows desktop.

The .NET Framework on the Windows desktop supports a large number of character encodings and code pages. You can get a complete list of encodings by calling the Encoding::GetEncodings method, which is available in the full .NET Framework on the Windows desktop. .NET Framework 4.6, on the other hand, by default supports only the following encodings:

To retrieve an encoding that is present in the .NET Framework on the Windows desktop but not in .NET Framework 4.6, you do the following:

  1. Add a reference to the System.Text.Encoding.CodePages.dll assembly to your project.

  2. Get the EncodingProvider object returned by the Instance property.

  3. Pass the EncodingProvider object to the Encoding::RegisterProvider method to make the encodings supplied by the EncodingProvider object available to the common language runtime.

  4. Call an Encoding::GetEncoding overload to retrieve the encoding. The Encoding::GetEncoding method will call the corresponding EncodingProvider::GetEncoding to determine whether it can supply the requested encoding.

.NET Framework

Supported in: 4.6
Show:
© 2017 Microsoft