It will NOT work. I can't think Why?
Because the MIME-encoded parts are not properly terminated. GIGO. They should end with ?=. By changing them to ensure that they are properly terminated they work fine.
#!/usr/bin/env perl use strict; use warnings; use Encode qw(encode decode); my @subject = ("Room Rush \303\242\302\200\302\223 Enjoy 25% off on yo +ur stay. (raw: Room Rush =?utf-8?b?4oCT?= Enjoy 25% off on your stay. +)", "Last Day To Enjoy Extra 15% OFF On Everything For NDB Credit Cards (r +aw: =?utf-8?Q?Last=20Day=20To=20Enjoy=20Extra=2015%=20OFF=20On=20Ever +ything=20For=20NDB=20Credit=20Cards?=)", "Sing Along and Dance with Desmond De Silva at Pegasus Reef Hotel! (ra +w: =?utf-8?Q?Sing=20Along=20and=20Dance=20with=20Desmond=20De=20Silva +=20at=20Pegasus=20Reef=20Hotel=21?=)"); for my $subj (@subject) { my $decoded = decode ("MIME-Header", $subj); print encode ("UTF-8", $decoded) . "\n"; }
In reply to Re^5: utf8 in perl
by hippo
in thread utf8 in perl
by theravadamonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |