Clear out junk bytes if the file is a UTF-8 with byte order mark

This commit is contained in:
Michael Becker 2014-12-04 21:41:45 -08:00
parent b30066e595
commit 8a042df9d8

View File

@ -322,7 +322,14 @@ namespace UniversalEditor.DataFormats.Markup.XML
while (!tr.EndOfStream)
{
char c = tr.ReadChar();
int times = 0, maxtimes = 5;
while (c != '<')
{
// clear out junk
c = tr.ReadChar();
times++;
if (times == maxtimes) break;
}
if (c == (char)65279) continue;
if (!loaded && (c != '<'))