in reply to Guessing encode text file

Hi,

without knowing the way Encode::Guess works, I'm pretty sure you mix up two things. When you want to guess the encoding than you should provide the raw byte stream. But with putting the utf8-layer to the input stream you force Perl to interpret the byte stream as utf8 encoded characters. But exactly this is what you want to find out with guessing the encoding.

So, open the file in binary mode, slurp the whole file if it's feasible and try guessing the encoding.

Best regards
McA