Random XML parse errors

Is anyone seeing random XML parse errors? The exact same XML will parse fine sometime and not others. In both situations the parsing is using the exact same code. It appears to be only when you use the XmlDocument( String ) constructor, rather than XmlDocument( File ) one.

Are you sure the encoding of the string is the same in all cases?

Yes, I’ve set the encoding to UTF-8 when reading. It’s the very same file so I know the bytes are OK. The debug window shows them as UTF-8 and copying and saving the contents to files shows no differences in the contents.

I’ve tracked it down a little more and it appears to be with how I’m reading the file. I will look at it some more and file a report when I’ve figured it out.

I have a client that has 4 installations of my app and only on one system does the parse fail. It is reading from exactly the same database as the 3 others (MySQL) and is the same compile (Windows desktop).

This is in the beta category. Is it new to 2013r4?

It appeared to be as I hadn’t noticed it in previous versions. I’m still checking. Currently I’m starting to think it’s about reading the file, rather than the XML parser. My code was using TextInputStream.Read( 32768) so that I could update a progressbar. I’m beginning to think it’s when the file was smaller than 32K it was causing problems. It’s possible that the issue is with Read rather than the parser.

Moving to Topic General as I now have a reproducible case and it’s not just the beta.
Filed as <https://xojo.com/issue/31082>