On Wed Feb 07 15:36:37 2007, nick.aevum.de wrote:
Show quoted text> The following code
>
> use Encode;
> print encode('MIME-Q', encode_utf8('12345678901234567890ä')), "\n";
WRONG^^^^^^^^^^^
The right way to do is:
# source is in latin1
use Encode;
print encode('MIME-Q', decode_utf8('12345678901234567890ä')), "\n";
or
# source is in utf-8
use Encode;
use utf8; # this makes sure literals are treated as UTF-8 string
print encode('MIME-Q', '12345678901234567890ä'), "\n";
And you will get
=?UTF-8?Q?12345678901234567890?==?UTF-8?Q?=C3=A4?=
remember, encode() takes UTF-8 string as source string.
Dan the Encode Maintainer