-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 5 Mar 2012, Gustavo Henrique Vieira wrote:

Everything works fine, but the warning text shows wrong characters.
My  OS  language  is  pt_BR.UTF-8  and  the  erros  are in 'ç' 'á' for
example, but inside 'warning1.txt' file everything is correct.

e.g. action_replace_with_warning() builds a new MIME::Entity of type "text/plain", but without character set. That leaves it to the MUA to pick a matching one. Was it Latin1 in time ago, many MUAs fall back to UTF8 nowadays, I think.

For testing purpose, you could add a Charset => "iso-8859-15" there. However, to be "save", you would need to ensure the encoding (Perl term for character set) of the text,

$ReplacementEntity = MIME::Entity->build(
        Type => "text/plain",
        Encoding => "-suggest",
        Charset => "iso-8859-15",
        Data => [ Encode::encode("iso-8859-15", "$msg\n", Encode::FB_QUIET) ]
);

Or use UTF8:

$ReplacementEntity = MIME::Entity->build(
        Type => "text/plain",
        Encoding => "-suggest",
        Charset => "UTF-8",
        Data => [ Encode::encode_utf8("$msg\n", Encode::FB_QUIET) ]
);

Currently, I collect all warnings and infos in an ARRAY and add a Warning part as 2nd part in filter_end(). In this process I make sure that I Encode::decode anything to Perl-internal UTF8 first, then I create an UTF8 part.

Kind regards,

- -- Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBT1hxVv41+pMevzVSAQJopAf/ThmDYOyJySm+FTXlfeHq2H5mNgmAcEn/
acewUg4jRKYj+Vs7o9XiVqaLZyhp1BSrDNrBY4OnLRcAlcQ0qJBTxK7VDxuROxel
7gA7CeQgdMT/ZdEXA5/NmjEl6bxk6tOUuoFGtkwy0mM0TLi9e8DVwPt5bvISrpOF
Pj644h/jeVVIDaKbTLxG1SsDfZkerD2Y0LDtHoSFJ7HLS9zGRbdBritCR/ELg/LW
CKJ760gX3pyrjgfajiVDjcXHaveWLxpdf51470TcqJZ1/NooMLT5Iv4nlyJIO3lc
RVAo/1QwG9NPLzqj0SArLfUujt7uDlfe2c5vzxEYj0i+2fhbdtZlYA==
=BxjS
-----END PGP SIGNATURE-----
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to