[PHP] Detecting The Encoding Of A Text File

2009-11-25 Thread Nitsan Bin-Nun
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 = mb_detect_encoding($contents, "UTF-8,ISO-8859-1,WINDOWS-1252"); //,Windows-125

[PHP] Detecting The Encoding Of A Text File

2009-11-25 Thread Nitsan Bin-Nun
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 = mb_detect_encoding($contents, "UTF-8,ISO-8859-1,WINDOWS-1252"); //,Windows-1255