Marc Scheuner [MVP ADSI] <(E-Mail Removed)> wrote:
<snip>
> Is there any easy way in C# to let it determine the file's encoding
> reliably? Do I really need to "manually" look at the first three bytes
> of each file?
There *is* no way of determining it reliably. Something that starts
with "abc" could be in UTF-8, ASCII, UCS-2 without any BOM, Cp1252,
etc...
If you know that all your files are going to be *either* UCS-2 with a
BOM or UTF-8, that makes things a lot simpler - but you'll still
basically have to look at the first few bytes.
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too