Specifying System.xml.xmldocument codepage

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello,
I have a really simple example that reproduces an error that Im seeing.
<div style="color:black; background-color:white
<pre><span style="color:blue Module
Module1<br/>
<br/>
<span style="color:blue Sub
Main()<br/>
<span style="color:blue Dim
TransDoc <span style="color:blue As
<span style="color:blue New
System.Xml.XmlDocument()<br/>
<span style="color:blue Try
<br/>
TransDoc.Load(<span style="color:#a31515 "c:deletemedeleteme.xml"
)<br/>
Console.WriteLine(<span style="color:#a31515 "Everything is fine."
)<br/>
<span style="color:blue Catch
ex <span style="color:blue As
Exception<br/>
Console.WriteLine(<span style="color:#a31515 "Error: "
& ex.ToString & <span style="color:#a31515 " occurred."
)<br/>
<span style="color:blue End
<span style="color:blue Try
<br/>
Console.WriteLine(<span style="color:#a31515 "Press any key to continue..."
)<br/>
Console.ReadLine()<br/>
<span style="color:blue End
<span style="color:blue Sub
<br/>
<br/>
<span style="color:blue End
<span style="color:blue Module
<br/>
<br/>
[/code]

Here is what c:deletemedeleteme.xml looks like:
<div style="color:black; background-color:white
<pre><span style="color:blue <
<span style="color:#a31515 Root
<span style="color:blue >
<br/>
< My_String="AutoritÃ" /><br/>
<span style="color:blue </
<span style="color:#a31515 Root
<span style="color:blue >
<br/>
[/code]

Im sure this is really simple, but Ive searched quite a while now and havent been able to figure out how to specify the codepage in System.Xml.XmlDocument.
I tried adding a <?xml version="1.0" encoding="UTF-8"?> to the top of deleteme.xml, but it didnt help.
Thanks,
Lance



View the full article
 
Back
Top