10 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use strict;
use MIME::WordDecoder;
sub decode_words {
my $value = shift || "";
my $wd = default MIME::WordDecoder;
eval q{require Encode; $value = Encode::decode('MIME-Header', $value);}; # falls kein Enocde vorhanden
$wd->handler("BIG5" => "KEEP");
$wd->handler("WINDOWS-1250" => "KEEP");
$wd->handler("WINDOWS-1251" => "KEEP");
$wd->handler("WINDOWS-1252" => "KEEP");
$wd->handler("WINDOWS-1253" => "KEEP");
$wd->handler("WINDOWS-1254" => "KEEP");
$wd->handler("WINDOWS-1255" => "KEEP");
$wd->handler("WINDOWS-1256" => "KEEP");
$wd->handler("WINDOWS-1257" => "KEEP");
$wd->handler("WINDOWS-1258" => "KEEP");
my $decoded = "";
eval { $decoded = $wd->decode($value); };
my $retval = $decoded ? $decoded : $value;
return ($retval);
}
my $subject = "=?iso-8859-1?Q?test_mit_3_Anh=E4ngen_01?=";
print decode_words($subject);
1
2
3
4
5
6
7
8
use MIME::Words ();
sub encode_words {
my $value = shift;
return ($value ? MIME::Words::encode_mimewords($value) : "");
}
print encode_words("test_mit_3_Anhängen");
test_mit_3_=?ISO-8859-1?Q?Anh=84ngen?=
test_mit_3_=?ISO-8859-1?Q?Anh=84ngen?=
10 Einträge, 1 Seite |