Re: Determining Encoding of a file
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 04/20/04
- Next message: Valery Pryamikov: "Re: Determining Encoding of a file"
- Previous message: Bob: "Determining Encoding of a file"
- In reply to: Bob: "Determining Encoding of a file"
- Next in thread: Valery Pryamikov: "Re: Determining Encoding of a file"
- Reply: Valery Pryamikov: "Re: Determining Encoding of a file"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Apr 2004 09:10:39 +0100
Bob <anonymous@discussions.microsoft.com> wrote:
> Is there something under the CLR that I can use to determine the
> encoding of a file that I am reading without me reading the first two
> bytes to see if they are set to a unicode BOM?
No. There *is* no such thing as an encoding of a file, for sure. Many
files are perfectly valid but with different meanings depending on
which encoding they're loaded with. There's no firm way of determining
the encoding - but looking at the first few bytes may give you a good
*idea*.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Valery Pryamikov: "Re: Determining Encoding of a file"
- Previous message: Bob: "Determining Encoding of a file"
- In reply to: Bob: "Determining Encoding of a file"
- Next in thread: Valery Pryamikov: "Re: Determining Encoding of a file"
- Reply: Valery Pryamikov: "Re: Determining Encoding of a file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|