I'm trying to read a file (not a XML, but the structure is similar), but i'm getting this Exception:
'┴', hexadecimal value 0x15, is an invalid character. Line 8, position 7.
and the file have a lot of this symbols, that I can't replace because I can't modify the content of the file for my purposes...
That's the code:
try
{
XDocument doc = new XDocument(new XDeclaration("1.0", "utf-16", "yes"));
doc = XDocument.Load(arquivo);
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString());
}
and that's some part of the file:
<Codepage>UTF16</Codepage>
<Segment>0000016125
<Control>0003┴300000┴English(U.S.)PORTUGUESE┴┴bla.000┴webgui\messages\xsl\en\blabla\blabla.xlf
</Control>
<Source>To blablablah the firewall to blablablah local IP address. </Source>
<Target>Para blablablah a uma blablablah local específico. </Target>
</Segment>
Note: The file don't have the encode xml declaration.