G
G.B.
Hi,
From the following lines in the docs of Encode::MIME::Header,
$utf8 = decode('MIME-Header', $header);
$header = encode('MIME-Header', $utf8);
one might be tempted to infer that $utf8 stands for UTF-8
encoded "text", i.e. bytes.
Apparently, it doesn't.
Proof: calling Encode::encode('MIME-Header', $perlstring), i.e.
not passing some UTF-8 encoded bytes, but passing a regular
character string instead, perl prints, as expected:
$ perl -e 'use Encode;
my $perlstring = "A \x{20AC} is worth \$1.35";
print STDOUT Encode::encode("MIME-Q", $perlstring), "\n";
'
=?UTF-8?Q?A=20=E2=82=AC=20is=20worth=20=241=2E35?=
The triple E2 82 AC is the UTF-8 triple of '€', as expected. QED.
Given the "utf8 flag fallacy", if you'll allow me to call it
that, do the above two lines from the pod really give a good hint?
TIA, Georg
From the following lines in the docs of Encode::MIME::Header,
$utf8 = decode('MIME-Header', $header);
$header = encode('MIME-Header', $utf8);
one might be tempted to infer that $utf8 stands for UTF-8
encoded "text", i.e. bytes.
Apparently, it doesn't.
Proof: calling Encode::encode('MIME-Header', $perlstring), i.e.
not passing some UTF-8 encoded bytes, but passing a regular
character string instead, perl prints, as expected:
$ perl -e 'use Encode;
my $perlstring = "A \x{20AC} is worth \$1.35";
print STDOUT Encode::encode("MIME-Q", $perlstring), "\n";
'
=?UTF-8?Q?A=20=E2=82=AC=20is=20worth=20=241=2E35?=
The triple E2 82 AC is the UTF-8 triple of '€', as expected. QED.
Given the "utf8 flag fallacy", if you'll allow me to call it
that, do the above two lines from the pod really give a good hint?
TIA, Georg