系统相关
首页 > 系统相关> > .Net Core 遇到 “'windows-1252' is not a supported encoding name.”

.Net Core 遇到 “'windows-1252' is not a supported encoding name.”

作者:互联网

使用iTextSharp生成Pdf文件时报错如下:

'windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name

需要在 NuGet 里添加 System.Text.Encoding.CodePages

 

 

 需要在程序里注册下,在报错语句前加入:

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

 

原文链接:https://www.cnblogs.com/sun8134/p/11423388.html

标签:RegisterProvider,Core,name,Encoding,windows,supported,encoding,1252
来源: https://www.cnblogs.com/Jackie-sky/p/11786050.html