Init

Initializes the lexicons used for localization.

encoding

Returns the encoding of the current lexicon, as yanked out of __ContentType's "charset" field. If it can't find anything, it returns 'ISO-8859-1'

SetMIMEEntityToUTF8 $entity

An utility method which will try to convert entity body into utf8. It's now a wrap-up of SetMIMEEntityToEncoding($entity, 'utf-8').

SetMIMEEntityToEncoding $entity, $encoding

An utility method which will try to convert entity body into specified charset encoding (encoded as octets, *not* unicode-strings). It will iterate all the entities in $entity, and try to convert each one into specified charset if whose Content-Type is 'text/plain'.

This method doesn't return anything meaningful.

DecodeMIMEWordsToUTF8 $raw

An utility method which mimics MIME::Words::decode_mimewords, but only limited functionality. This function returns an utf-8 string.

It returns the decoded string, or the original string if it's not encoded. Since the subroutine converts specified string into utf-8 charset, it should not alter a subject written in English.

Why not use MIME::Words directly? Because it fails in RT when I tried. Maybe it's ok now.

_FindOrGuessCharset MIME::Entity, $head_only

When handed a MIME::Entity will first attempt to read what charset the message is encoded in. Failing that, will use Encode::Guess to try to figure it out

If $head_only is true, only guesses charset for head parts. This is because header's encoding (e.g. filename="...") may be different from that of body's.

_GuessCharset STRING

use Encode::Guess to try to figure it out the string's encoding.

SetMIMEHeadToEncoding HEAD OLD_CHARSET NEW_CHARSET

Converts a MIME Head from one encoding to another. This totally violates the RFC. We should never need this. But, Surprise!, MUAs are badly broken and do this kind of stuff all the time