[Mono-dev] XmlTextReader problems in mono 2.10.2

Euan MacInnes euan_macinnes at hotmail.com
Mon Jul 25 03:05:00 EDT 2011





Hi,    I'm having problems reading UTF-8 encoded XML files, only in mono on Linux and MacOSX (2.10.2 and 2.10.1 respectively). 2.10.2 on Windows 7 64 bit runs just fine, as does .NET The issue is that the XmlTextReader can't open an XML file with UTF-8 encoding, it comes up with an old error, '?>' is Expected as Mono.Xml2.XmlTextReader.Expect. This seems true of any Xml file, as long as it is UTF-8 encoded, which I need for multiple language support, as I need translations inside the single XMl file. I am using the following code to initialise the XmlTextReader:             XmlReaderSettings settings = new XmlReaderSettings();
                              settings.ConformanceLevel = ConformanceLevel.Auto;
                              settings.IgnoreWhitespace = true;
                              settings.IgnoreComments = true;
                              settings.ValidationType = ValidationType.None;
 
                              XmlReader reader = XmlReader.Create(IFXstream, settings);            
 
            XmlDocument IFXmodel = new XmlDocument();
            IFXmodel.Load(reader);Setting the ConformanceLevel.Auto fixed it running in Mono on Windows, but still left it broken on Linux and MacOSX. I tried converting the files to UTF-32, but then I just get a NullReferenceException. Converting to Western ISO won't work as gedit reports there are characters in the file that will be lost in the conversion. Any thoughts? Cheers, Euan.       		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110725/8e2e77db/attachment.html 


More information about the Mono-devel-list mailing list