No data is available for encoding 1252

Sami C.
1 min readSep 15, 2019

--

.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:

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

And simply initialize the following:

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

Hopefully this helped you!

Happy Programming!

--

--