本文介绍了我无法使用unicode字符创建xelement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法使用包含unicode的字符串创建XElement。
下面的代码无法创建XElement。如何使用unicode创建一个XElement。
I am unable to create XElement with the string which contains the unicode.
Below code is failing to create XElement. How can I create an XElement with the unicode.
XDocument xDoc = new XDocument(
new XElement("Pubs",
new XElement("Book",
new XElement("Title", "Social Service"),
new XElement("Author", "Nagsert")),
new XElement("Book",
new XElement("Title", "Self Motivation"),
new XElement("Author", "Srinu")
)
)
);
// XElement String contains unicode
xDoc.Root.Add(new XElement("Book",
new XElement("Title", "Problem Is Still Exist"),
new XElement("Author", "Gazit, Inbar")
));e>
这篇关于我无法使用unicode字符创建xelement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!