Nathan,
I was having the same problem, and I also suspected that the encoding was actually okay and the XML was just tagged incorrectly. I created the following function which replaces the ISO-8859-1 tag with a UTF-8 tag. After that, the XML Document processor worked perfectly. Admittedly, this function is a hack, woefully inefficient, and error-prone, but it's a starting point, and it got me past this annoying issue. Hopefully this will help someone else as well.
Public Function DownloadToXML(ByVal p_URL As String) As System.Xml.XmlDocument
Dim l_WebRequest As WebRequest
Dim l_XMLDoc As XmlDocument
Dim l_Stream As Stream
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
Try
l_WebRequest = System.Net.HttpWebRequest.Create(p_URL)
l_Stream = l_WebRequest.GetResponse.GetResponseStream()
l_XMLDoc = New System.Xml.XmlDocument
l_XMLDoc.Load(ConvertISO8859ToUTF8(l_Stream))
Catch ex As Exception
MsgBox("Unable to download XML: " & ex.Message.ToString)
End Try
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
Return l_XMLDoc
End Function
Private Function ConvertISO8859ToUTF8(ByVal p_Stream As Stream) As Stream
Dim l_StreamOut As New MemoryStream
Dim l_StreamReader As New StreamReader(p_Stream)
Dim l_StreamWriter As New StreamWriter(l_StreamOut)
Dim l_Line As String
l_Line = l_StreamReader.ReadLine()
If (Not l_Line Is Nothing) Then
l_Line = Replace(l_Line, "encoding=""ISO-8859-1""", "encoding=""UTF-8""")
l_StreamWriter.WriteLine(l_Line)
End If
Do
l_Line = l_StreamReader.ReadLine()
If (Not l_Line Is Nothing) Then
l_StreamWriter.WriteLine(l_Line)
End If
Loop Until l_Line Is Nothing
l_StreamReader.Close()
l_StreamWriter.Flush()
l_StreamOut.Seek(0, SeekOrigin.Begin)
Return l_StreamOut
End Function