Re: Re: Detecting The Encoding Of A Text File
| From: | Nisse Engström | Date: | Thu, 26 Nov 2009 14:49:26 +0000 |
| Subject: | Re: Re: Detecting The Encoding Of A Text File | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300124@lists.php.net to get a copy of this message | ||
On Thu, 26 Nov 2009 15:39:04 +0200, דניאל דנון wrote:
> If windows notepad can detect encoding there must be a way to do it
> yourself.
>
> Maybe try to get the file's headers, I think it should also contain the
> encoding of the file...
Plain text files don't have any headers. Perhaps they use
heuristics, eg. examine the distribution of characters to
determine a probable encoding.
[Quick Google...]
<http://blogs.msdn.com/oldnewthing/archive/2007/04/17/2158334.aspx>
/Nisse