Re: Body charset for Mail::Message::Field::Full

Mike Mimic <[email protected]> Fri, 10 Sep 2004 00:30:32 -0700 (PDT)
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
Hi!

--- Mark Overmeer <[email protected]> wrote:
> * Mike Mimic ([email protected]) [040828 15:01]:
> > Why should body for Mail::Message::Field::Full be
> > given in utf8? What if I already have a text in a
> > charset which I would use later on for encoding.
> > For example, at the moment I have to do ($text is
> > already in windows-1250 charset):
> > 
> > $subject =
> > Mail::Message::Field::Full->new('Subject',
> >    decode('windows-1250', $text),
> >    charset=>'windows-1250');

I got a feeling that there is some misunderstanding or
I just do not understand what is *so* wrong with this.

I would only like to optimize building the field so
that there would be no need to convert the string to
utf8 only that later on module would convert the
string back to its previous state.

>  $disp = Mail::Message::Field::Full->new
>     ( 'Content-Disposition: attachment;
>      filename="xyz"', charset => 'windows-1250'
>     );
>  my $body = Mail::Message::Body->new
>    ( dispostion => $disp
>    , ...
>    );
> 
> and then
> my $fn = $msg->body->dispositionFilename;
> would give inconsistent results.  Ok, this is a
> complex example, but I am sure there are hazards all
> over the place.

I have to admit that I have no idea why is this wrong.

> IMO, using other encodings that ASCII and UTF8
> inside a Perl program will be horrible to maintain.

But I think that internaly everything would be the
same. The guestion is only with this line:

my $encoded = Encode::encode($charset, $utf8, 0);

Everything else is the same.

> As second point: a header field should not be in
> "windows-1250": only ASCII is permitted by the RFCs.

> When non-ascii (7 bit) characters appear, they
> should be encoded with =?Q?windows-1250?...?=
> I know it is not practice, but it is standards
> compliant.

That is the reason why I got the feeling that there is
something misunderstood. With my idea everything would
else would be the same and it this case is would be
encoded and everything - like the standards say.


Mike


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail