在使用npoi导出doc文件时执行到
var document = new HWPFDocument(formFile.OpenReadStream());
报'Windows-1252' is not a supported encoding name错误
解决方法 在这段代码上面加入
var ep = CodePagesEncodingProvider.Instance;
Encoding.RegisterProvider(ep);
程序中如果没有相应的包则可在nuget中搜索 System.Text.Encoding.CodePages 进行安装

解决方法参考自:https://stackoverflow.com/questions/13563973/windows-1255-is-not-a-supported-encoding-name
博客主要讲述使用npoi导出doc文件时,出现'Windows-1252'不是支持的编码名称错误。解决办法是在报错代码上面加入相关内容,若程序中无相应包,可在nuget中搜索System.Text.Encoding.CodePages进行安装,还给出参考链接。
606

被折叠的 条评论
为什么被折叠?



