Re: [PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread דניאל דנון
I was thinking that if notepad can open it correctly it has headers - but the link you gave clarify that, my bad. 2009/11/26 Nisse Engström > 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. > > > > Mayb

Re: [PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread Nisse Engström
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

Re: [PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread Ashley Sheridan
On Thu, 2009-11-26 at 15:39 +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... > > 2009/11/26 Nitsan Bin-Nun > > > Someone have already

Re: [PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread דניאל דנון
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... 2009/11/26 Nitsan Bin-Nun > Someone have already suggested it but I haven't tried it yet. > > The thing is that right now

Re: [PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread Nitsan Bin-Nun
Someone have already suggested it but I haven't tried it yet. The thing is that right now it contains Hebrew, but tommorrow this file will be in German or any other accented language. I'm trying to create a function which would detect the encoding and convert it into UTF8. (I don't have much expe

[PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread Nisse Engström
On Thu, 26 Nov 2009 06:55:31 +0200, Nitsan Bin-Nun wrote: > Hi, > > I have been trying for the last couple of hours to determine the > encoding of a text file (.txt in windowz). > > I have this code: > > $contents = file_get_contents($config[' > txt_dir'] . $file); > $encoding =