System.NotSupportedException: No data is available for encoding 1252

后端 未结 2 1661
渐次进展
渐次进展 2021-01-01 10:18

I\'m working with a Trust Commerce Tutorial on how to generate a payment token that will allow customers to use the TC Trustee Host payment form. I was given an example on h

2条回答
  •  盖世英雄少女心
    2021-01-01 11:05

    .NET Core supports only ASCII, ISO-8859-1 and Unicode encodings, whereas .NET Framework supports much more.

    However, .NET Core can be extended to support additional encodings like Windows-1252, Shift-JIS, GB2312 by registering the CodePagesEncodingProvider from the System.Text.Encoding.CodePages NuGet package.

    After the NuGet package is installed the following steps as described in the documentation for the CodePagesEncodingProvider class must be done to register the provider:

    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.

提交回复
热议问题