CodePagesEncodingProvider.Instance 属性

定义

获取桌面 .NET Framework 支持但当前 .NET Framework 平台不支持的代码页的编码提供程序。Gets an encoding provider for code pages supported in the desktop .NET Framework but not in the current .NET Framework platform.

public:
 static property System::Text::EncodingProvider ^ Instance { System::Text::EncodingProvider ^ get(); };
public static System.Text.EncodingProvider Instance { get; }
member this.Instance : System.Text.EncodingProvider
Public Shared ReadOnly Property Instance As EncodingProvider

属性值

允许访问当前 .NET Framework 平台上不支持的编码的编码提供程序。An encoding provider that allows access to encodings not supported on the current .NET Framework platform.

注解

.NET Framework 支持大量字符编码和代码页。The .NET Framework supports a large number of character encodings and code pages. 可以通过调用 .NET Framework 中提供的 Encoding.GetEncodings 方法来获取完整的编码列表。You can get a complete list of encodings by calling the Encoding.GetEncodings method, which is available in the .NET Framework. 另一方面,.NET Core 在默认情况下仅支持以下编码:On the other hand, .NET Core only supports the following encodings by default:

  • ASCII (代码页20127),由 Encoding.ASCII 属性返回。ASCII (code page 20127), which is returned by the Encoding.ASCII property.

  • ISO-8859-1 (代码页28591)。ISO-8859-1 (code page 28591).

  • UTF-8 (代码页65000),由 Encoding.UTF7 属性返回。UTF-7 (code page 65000), which is returned by the Encoding.UTF7 property.

  • UTF-8 (代码页65001),由 Encoding.UTF8 属性返回。UTF-8 (code page 65001), which is returned by the Encoding.UTF8 property.

  • UTF-16 和 UTF-16LE (代码页1200),由 Encoding.Unicode 属性返回。UTF-16 and UTF-16LE (code page 1200), which is returned by the Encoding.Unicode property.

  • UTF-16BE (代码页1201),通过使用 truebigEndian 值调用 UnicodeEncoding.UnicodeEncodingUnicodeEncoding.UnicodeEncoding 构造函数来实例化。UTF-16BE (code page 1201), which is instantiated by calling the UnicodeEncoding.UnicodeEncoding or UnicodeEncoding.UnicodeEncoding constructor with a bigEndian value of true.

  • 32LE 属性 Encoding.UTF32 返回的32和 UTF-(代码页12000)。UTF-32 and UTF-32LE (code page 12000), which is returned by the Encoding.UTF32 property.

  • 32BE (代码页12001),该实例通过调用具有 bigEndian 参数的 UTF32Encoding 构造函数并在方法调用中提供 true 的值来进行实例化。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.

若要检索在 Windows 桌面的 .NET Framework 中存在但在 .NET Core 中不存在的编码,请执行以下操作:To retrieve an encoding that is present in the .NET Framework on the Windows desktop but not in .NET Core, you do the following:

适用于