perl-Encode-Detect detects charset of the input data and detects it using the encoder of the detected charsets. This is recommended with spamassassin.