CodePagesEncodingProvider Class
Provides access to an encoding provider for code pages supported in the desktop .NET Framework but not in UWP apps.
Assembly: System.Text.Encoding.CodePages (in System.Text.Encoding.CodePages.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | Instance | Gets an encoding provider for code pages supported in the desktop .NET Framework but not in the current .NET Framework platform. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | ToString() | (Inherited from Object.) |
Note |
|---|
The CodePagesEncodingProvider class is supported in the .NET Native implementation of .NET Core only. |
The .NET Framework for the Windows desktop supports a large set of Unicode and code page encodings. The Universal Windows platform and .NET Native, on the other hand, support only the following encodings:
ASCII (code page 20127), which is returned by the Encoding::ASCII property.
ISO-8859-1 (code page 28591).
UTF-7 (code page 65000), which is returned by the Encoding::UTF7 property.
UTF-8 (code page 65001), which is returned by the Encoding::UTF8 property.
UTF-16 and UTF-16LE (code page 1200), which is returned by the Encoding::Unicode property.
UTF-16BE (code page 1201), which is instantiated by calling the UnicodeEncoding::UnicodeEncoding or UnicodeEncoding::UnicodeEncoding constructor with a bigEndian value of true.
UTF-32 and UTF-32LE (code page 12000), which is returned by the Encoding::UTF32 property.
UTF-32BE (code page 12001), which is instantiated by calling an UTF32Encoding constructor that has a bigEndian parameter and providing a value of true in the method call.
Other than code page 20127, code page encodings are not supported.
The CodePagesEncodingProvider class extends EncodingProvider to make these code pages available to .NET Native and Universal Windows Platform (UWP) apps. To use these additional code pages, you do the following:
Add a reference to the System.Text.Encoding.CodePages.dll assembly to your project.
Retrieve a CodePagesEncodingProvider object from the static CodePagesEncodingProvider::Instance property.
Pass the CodePagesEncodingProvider object to the Encoding::RegisterProvider method.
After an EncodingProvider object is registered, the encodings that it supports are available by calling the overloads of Encoding::GetEncoding; you should not call the EncodingProvider::GetEncoding overloads.
Available since 10
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



