I'm reading from a file that sometime is saved as ANSI and sometimes is
saved as UTF-8
Because it has some danish characters like "æøå" in it, I have to read it
with "windows-1252" encoding if is saved as ANSI:
Encoding ediEncoding = Encoding.GetEnc oding( "windows-1252" );
StreamReader streamReader = new StreamReader(or iginalStrm,ediE ncoding);
But if it's saved as UTF-8 it have to be read with the default encoding.
Is there a way to find out how the file is saved, so I can programatical
choose the right encoding?
Tanks in advance.
Regards Paw
saved as UTF-8
Because it has some danish characters like "æøå" in it, I have to read it
with "windows-1252" encoding if is saved as ANSI:
Encoding ediEncoding = Encoding.GetEnc oding( "windows-1252" );
StreamReader streamReader = new StreamReader(or iginalStrm,ediE ncoding);
But if it's saved as UTF-8 it have to be read with the default encoding.
Is there a way to find out how the file is saved, so I can programatical
choose the right encoding?
Tanks in advance.
Regards Paw
Comment