in reply to Re^3: Decoding an email body, into utf8
in thread Decoding an email body, into utf8
Mmmm actually, that doesn't work in some cases:
my $name = "From: =?UTF-8?B?QW5keSBOZXdieSDDrcOpw7M=?= <andy\@cham +bresdhotesfrance.com>"; use MIME::QuotedPrint; if ($name =~ /utf-8|utf8/i) { $name= decode_qp($name); $name =~ s/([\200-\377]+)/from_utf8({ -string => $1, -charset +=> 'ISO-8859-1'})/eg; } print $IN->header; print "NOW: $name";
Prints out:
NOW: From: =?UTF-8?B?QW5keSBOZXdieSDDrcOpw7M=?=...instead of what I was expecting:
Andy Newby νσι
This is a valid email header passed through from Thunderbird. Any ideas why it won't decode?
Cheers
Andy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Decoding an email body, into utf8
by ultranerds (Hermit) on Jul 27, 2016 at 05:42 UTC | |
by soonix (Chancellor) on Jul 30, 2016 at 06:20 UTC |