小编Pie*_*pen的帖子

偶尔的System.NotSupportedException:没有数据可用于编码1252

在Windows IIS上的.NET Core 2.0中,我正在将一个部分html文件读入字符串:

   string sWelcomeContent = System.IO.File.ReadAllText(welcomepagePath, System.Text.Encoding.GetEncoding(1252));
Run Code Online (Sandbox Code Playgroud)

这很正常,但很少(去年发生过两次),我收到一个错误:System.NotSupportedException:没有数据可用于编码1252.

任何想法为什么会这样?

asp.net-core

1
推荐指数
1
解决办法
352
查看次数

标签 统计

asp.net-core ×1