.net core default does not support gb2312

When collecting data, garbled, I encountered this situation before, so the old way:

Decisive use Encoding.GetEncoding ( "GB2312"), throw an exception. Search the next, is not supported by default because the .net core gb2312

Therefore, two ways: one, to .net 2, incorporated in Nuget system.text.encoding.codepages, coupled with the line of code: Encoding.RegisterProvider (CodePagesEncodingProvider.Instance)

 

Guess you like

Origin www.cnblogs.com/dayang12525/p/11084280.html