1
我有一个特殊符号的文本文件,例如£,€我想将它写入xml文件,同时写入这些符号它被写为问号。文本文件中的符号被错误地写入xml文件
下面是我的代码:
String[] data = File.ReadAllLines("SpecialSymbols.TXT");
XElement root = new XElement("root",
from item in data
select new XElement("Line", item));
root.Save("XmlFile.Xml");
你可以看到[从实现(http://referencesource.microsoft.com/#mscorlib/system/io/file.cs,990),这将没有什么区别。我同意这看起来像一个编码问题,但是。 –