.NET Core中如何获取GB2312编码的Encoding

8/4/2020 4:42:10 PM

需要安装 nuget 包 System.Text.Encoding.CodePages

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
var encoding = Encoding.GetEncoding("GB2312");