dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

How to use the "CodePagesEncodingProvider" Class at .NET core 2.1?

Open moyanming opened this issue 7 years ago • 3 comments

I want to use the code page (e.g. code page 936) which is not supported in UWP apps. I can get the code page 936 by use the "CodePagesEncodingProvider" class at .NET core 2.0, but it seems that there is not available at .NET core 2.1, how to fix this? Best regards.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

moyanming avatar Aug 10 '18 09:08 moyanming

CodePagesEncodingProvider works for me in a .Net Core 2.1 console application the same as in a .Net Core 2.0 console application, after I install the System.Text.Encoding.CodePages package from NuGet. Is that not the same for UWP?

Though I think the current documentation is not great and I have opened a separate issue about that: https://github.com/dotnet/docs/issues/7086.

svick avatar Aug 18 '18 12:08 svick

Hi @svick , CodePagesEncodingProvider works for me too now, but I don't know how to conform the version of the .NET Core which I use now. I got message on the CodePagesEncodingProvider class websit: "The requested page is not available for .NET Core 2.1. You have been redirected to the newest product version this page is available for." I am afraid that the CodePagesEncodingProvider class can't be use in future, as this class is important for me. Thank you for the new open issus #7086 !

moyanming avatar Aug 20 '18 03:08 moyanming

For Azure Function 2.0 with .NET Standard 2.0 I needed the same NuGet package which is not obvious from the current doc.

daviburg avatar Sep 05 '18 19:09 daviburg