[Mimedefang] unicode problem in mimedefang

Jan-Pieter Cornet johnpc at xs4all.nl
Tue Feb 5 10:51:17 EST 2008


On Tue, Feb 05, 2008 at 02:25:21PM +0100, Steffen Kaiser wrote:
> >>i write the value of $fname in some file.
> >>it works fine
> >>but if filename is in japanese, then garbage characaters are written to 
> >>file.
> >>does mimedegang does not support unicode.

Err... OK, sorry. You (Vinita Batra) are right. The $filename argument
to filter and filter_multipart _does_ contain garbage. It looks like
mimedefang looses the encoding, so the data becomes worthless.

It's more reliable to get your own filename out of the entity itself,
so you can preserve the encoding. Sorry, no code example, you'll have to
dig into the manpage of MIME::Entity and MIME::Tools.

> Well, what kind if "garbage" is it? Maybe, the garbage is no garbage at 
> all for humans displaying the stuff in another character set or for a 
> computer applying some nice decodings about it.
> 
> >Nope, mimedefang does nothing with unicode... because perl handles all
> >that.
> 
> Well, that's not that easy, because:
> 
> a) Perl must know the character set, the string consists of.

mimedefang throws the character set away. At least for the $filename
argument.

-- 
Jan-Pieter Cornet <johnpc at xs4all.nl>
!! Disclamer: The addressee of this email is not the intended recipient. !!
!! This is only a test of the echelon and data retention systems. Please !!
!! archive this message indefinitely to allow verification of the logs.  !!



More information about the MIMEDefang mailing list