View Single Post
  #4 (permalink)  
Old 10-05-2008, 8:44 AM
JohnH's Avatar
JohnH JohnH is offline
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,325
Reputation: 1315
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

That is very strange, utf-8 is detected. When saving this to file I see there is no file encoding prefix (BOM), and there shouldn't need to be from Xml point of view. If I open it in Notepad and save as utf-8 a BOM is added, if I then use XmlTextReader from this file it reads correctly. I think this must be a bug. Workaround could be this:
Code:
Dim web As New Net.WebClient
My.Computer.FileSystem.WriteAllText("temp4.xml", web.DownloadString(URL), False, System.Text.Encoding.UTF8)      
Dim XmlRdr = New XmlTextReader("temp4.xml")
__________________
Reply With Quote