CodePagesEncodingProvider Class

.NET Framework (current version)

Provides access to an encoding provider for code pages supported in the desktop .NET Framework but not in .NET Core.

System::Object
  System.Text::EncodingProvider
    System.Text::CodePagesEncodingProvider

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

public ref class CodePagesEncodingProvider sealed : public EncodingProvider

The CodePagesEncodingProvider type exposes the following members.

  NameDescription
Public propertyStatic memberInstanceGets an encoding provider for code pages supported in the desktop .NET Framework but not in the current .NET Framework platform.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetEncoding(Int32)Returns the encoding associated with the specified code page identifier. (Overrides EncodingProvider::GetEncoding(Int32).)
Public methodGetEncoding(String)Returns the encoding with the specified name. (Overrides EncodingProvider::GetEncoding(String).)
Public methodGetEncoding(Int32, EncoderFallback, DecoderFallback)Returns the encoding associated with the specified code page identifier. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. (Inherited from EncodingProvider.)
Public methodGetEncoding(String, EncoderFallback, DecoderFallback)Returns the encoding associated with the specified name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. (Inherited from EncodingProvider.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

NoteNote

CodePagesEncodingProvider class is supported in .NET Core only.

The .NET Framework for the Windows desktop supports a large set of Unicode and code page encodings. .NET Core, on the other hand, supports only the following encodings:

Other than code page 20127, code page encodings are not supported.

The CodePagesEncodingProvider class extends EncodingProvider to make these code pages available to .NET Framework 4.6. To use these additional code pages, you do the following:

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

  2. Retrieve a CodePagesEncodingProvider object from the static Instance property.

  3. Pass the CodePagesEncodingProvider object to the Encoding::RegisterProvider method.

After an EncodingProvider object is registered, the encodings that it makes supports are available by calling the overloads of Encoding::GetEncoding; you should not call the CodePagesEncodingProvider::GetEncoding overloads.

.NET Framework

Supported in: 4.6

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: