Show all encodings with .NET 5+

When using .NET core, by default, we can't get all the encodings that are available in .NET Framework when interating over Encoding.GetEncodings(). To see all encodings, we should do the following in the application startsup

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

Post a Comment

Previous Post Next Post