Clear out junk bytes if the file is a UTF-8 with byte order mark
This commit is contained in:
parent
b30066e595
commit
8a042df9d8
@ -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 != '<'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user