Wing <wing(_at_)wing(_dot_)com> writes:
"John Delacour" <JD(_at_)BD8(_dot_)COM> wrote in message
news:p06230908bfd76273ea14(_at_)[10(_dot_)0(_dot_)0(_dot_)1](_dot_)(_dot_)(_dot_)
At 12:42 am +0800 28/12/05, wing wrote:
I need to encode the subject line in a MIME header in UTF8 (something like
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=). I know that
this can be done by using Encode in Perl 5.8. However, in my production
environment, we can only use Perl 5.6 at this moment.
Is there anywhere to do the encoding in Perl 5.6? I would appreciate if
you
can provide an example to show how to do it.
What range of characters do you need to encode and what operating system
are you using? The MIME encoding is no problem with MIME::Base64 but what
is the encoding of the text you start with?
JD
Thanks for your prompt reply. The subject line contains some Chinese or
Japanese characters in UTF8. Can they be encoded as UTF8 with MIME:Base64?
Yes. It would look like =?UTF-8?B?xxxxxxxxxxxxxxxxxxxxxxxxxxx?=
where xxxxxxxxxxxxxxxx part is output of encode_base64
The tricky part (for perl5.6) is to get UTF-8 encoded octet sequence
that is input to encode_base64.
I have added a euro sign '€' to subject of this mail so my (perl5.8) mail client
does UTF-8 thing. But it will use Q style as that is shorter in this case.
Thanks,
Wing