in reply to Detecting charset in email

You can use Encode::Guess, I believe, which performs a guess. To be a good guess, you have to prime it with the most likely charsets (e.g. if you are expecting English, probably ASCII, ISO-8859-1, etc., while if you are expecting Japanese...).

However, here is a shameless plug for a project I'm tangentially working with (though not leading): HEBCI, or HTML Entity Based Codepage Inference, though I often forget that and think it's Heuristic Estimation of Bytes' Charset, Idiomatically, or such.

HEBCI is the way to figure out a charset by sending some stuff that comes back differently in different charsets, and checking the differences. HEBCI is an HTML way to do this, but I imagine that you could try the same principle with email, in the event that Encode::Guess doesn't suffice.

Replies are listed 'Best First'.
Re^2: Detecting charset in email
by tertullian01 (Acolyte) on Jun 27, 2005 at 13:28 UTC
    I have tried to use Encoding::Guess but the server I am using has PERL 5.6.1 and the module requires v 5.7.3. This is the error it returned when I tried to install it:
    Perl v5.7.3 required--this is only v5.6.1, stopped at Makefile.PL line + 1. BEGIN failed--compilation aborted at Makefile.PL line 1.