zl程序教程

您现在的位置是:首页 >  前端

当前栏目

System.Xml.XmlException: There is no Unicode byte order mark. Cannot switch to Unicode.

XML to is Cannot No system order Unicode
2023-09-11 14:14:17 时间

System.Xml.XmlException: There is no Unicode byte order mark. Cannot switch to Unicode.

传递给函数的路径是Load file C:\workspace\GitHub\ChuckLu\ChuckFork\FatAntelope\FatAntelope.CommandLine\bin\Debug\..\..\..\ConsoleApp1\sample\source.xml failed.

应该需要用GetFullPath处理一下

 

<?xml version="1.0" encoding="utf-8"?> 文件开头的编码和文件本身保存的编码不匹配,所以报错