Leser: 1
9 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw(:standard);
use Encode;
print header('text/plain');
my $var = param('test');
$var = decode_utf8($var);
print $var;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use Encode;
$logger->debug("Subject is UTF8:", utf8::is_utf8($p{subject}) );
$logger->debug("Body is UTF8:", utf8::is_utf8($p{body}));
$p{subject} = decode_utf8($p{subject});
$p{body] = decode_utf8($p{body});
my %mail_p = (
From => $p{from},
To => $p{to},
Subject => $p{subject},
Data => $p{body},
);
my $mime = MIME::Lite->new(%mail_p);
$mime->attr('content-type.charset' => 'UTF8';);
$mime->send;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;
use Encode;
use Encode::Guess;
use MIME::Words qw(:all);
my $mime = MIME::Lite->new( {
From => mime_escape( $p{from} ),
To => mime_escape( $p{to} ),
Subject => mime_escape( $p{subject} ),
Data => $p{body},
} );
$mime->attr('content-type.charset' => 'UTF8';);
$mime->send;
sub mime_escape {
my $data = shift || '';
my $utf8 = decode("Guess", $data);
return encode_mimewords( $utf8 );
}
9 Einträge, 1 Seite |