我有一个XML属性包含重音字符:
<TestCase Name="Canadian Addresses - Test Case" Description="Canadian Addresses - Test Case" OnOff="True" NegativeTest="False" RollbackDB="False" Performance="False" PerformanceSummary="False" TimesToExecute="1">
<ProviderFacilitySearch_FindProviderFacility ProviderInfo="Dr Marc-André Kärcher Samuels Senior|10 Château du Feÿ Ave, North Building, North Sydney, NS B2A 3L7 CANADA" />
<ProviderFacilitySearch_ViewProviderFacility ProviderInfo="Dr Marc-André Kärcher Samuels Senior|10 Château du Feÿ Ave, North Building, North Sydney, NS B2A 3L7 CANADA" />
<ViewProvider_LocationName ExpectedLocationName="Kärcher Health Care" />
<ViewProvider_ServicingAddress ExpectedServicingAddress="10 Château du Feÿ Ave|Central Building|North Sydney, NS B2A 3L7|CANADA" />
<ViewProvider_ExpandMailingAddress NA="" />
<ViewProvider_MailingAddress ExpectedMailingAddress="10 Château du Feÿ Ave|Central Building|North Sydney, NS B2A 3L7|CANADA" />
<ViewProvider_ExpandBillingAddress NA="" />
<ViewProvider_BillingAddress ExpectedBillingAddress="10 Château du Feÿ Ave|Central Building|North Sydney, NS B2A 3L7|CANADA" />
<ViewProvider_Close NA="" />
<ProviderFacilitySearch_Cancel NA="" />
<UserLogout/>
</TestCase>
当我使用C#代码读取这个XML文件时,出现如下错误:
5/8/2013 2:39:03 PM 错误: System.Xml.XmlException: 给定编码中存在无效字符。第86行,第74个位置。 at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
我甚至无法使用IE打开这个页面。
有没有办法解决这个问题呢?