1
2
3
4
$ perl -Mutf8 -MEncode -E 'say encode("MIME-Header", "Hallöle")'
=?UTF-8?B?SGFsbMO2bGU=?=
$ perl -MEncode -E 'say encode("UTF-8", decode("MIME-Header", "=?UTF-8?B?SGFsbMO2bGU=?="))'
Hallöle
1 2 3 4
use Encode; use bytes; # wegen der Ausgabe auf STDOUT print decode("MIME-Header", '=?UTF-8?Q?Schl=C3=A4fst_du_unter_L=C3=84RM=3F_W?= =?UTF-8?Q?ow_respect_?=');
1 2
use Encode; say encode("UTF-8", decode("MIME-Header", "=?UTF-8?Q?Schl=C3=A4fst_du_unter_L=C3=84RM=3F_W?= =?UTF-8?Q?ow_respect_?="))'
1 2
use Encode; say encode("cp1252", decode("MIME-Header", "=?UTF-8?Q?Schl=C3=A4fst_du_unter_L=C3=84RM=3F_W?= =?UTF-8?Q?ow_respect_?="))'
1 2
use Encode; say encode("cp850", decode("MIME-Header", "=?UTF-8?Q?Schl=C3=A4fst_du_unter_L=C3=84RM=3F_W?= =?UTF-8?Q?ow_respect_?="))'
QuoteThis pragma reflects early attempts to incorporate Unicode into perl and has since been superseded. It breaks encapsulation (i.e. it exposes the innards of how the perl executable currently happens to store a string), and use of this module for anything other than debugging purposes is strongly discouraged. If you feel that the functions here within might be useful for your application, this possibly indicates a mismatch between your mental model of Perl Unicode and the current reality.
QuoteThis pragma reflects early attempts to incorporate Unicode into perl and has since been superseded. It breaks encapsulation (i.e. it exposes the innards of how the perl executable currently happens to store a string), and use of this module for anything other than debugging purposes is strongly discouraged. If you feel that the functions here within might be useful for your application, this possibly indicates a mismatch between your mental model of Perl Unicode and the current reality.