http://qs321.pair.com?node_id=1217851

theravadamonk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Perl Monks,

I have a maillog file which contains Subject and From addresses with utf8.

Here's a bit of the maillog. Pls pay attention to Subject: and From:

mail_id: 3gTkbdw2YlQK, b: pru-s06Xc, Hits: 8.111, size: 40657, Subject +: "Heritage The Latest & Most Luxurious Banquet Hall In Anuradhapura +(raw: =?utf-8?Q?Heritage=20The=20Latest=20&=20Most=20Luxurious=20Banq +uet=20Hall=20In=20Anuradhapura?=)", From: Heritage_Hotel_Anuradhapura +_<ads@adzinair.net>_(raw:_=?utf-8?Q?Heritage=20Hotel=20Anuradhapura?= +_<ads@adzinair.net>), X-Mailer: MailChimp_Mailer_-_**CID8fa1f72d0e77e +89b5794**

I want to get it displayed in proper way. I still can't it. It STILL gives raw: =?utf-8?Q? etc..

I have added below lines to my perl code.

#!/usr/bin/perl use CGI ':standard'; use strict; use warnings; use CGI::Carp 'fatalsToBrowser'; # use only for testing print "Content-Type: text/html; charset=utf-8\n\n"; open FILE, '<:encoding(utf8)', '/var/log/mail.log' or die $!; my @file = reverse <FILE>;

Anyway, I am reading the file in Revers Order. where hv I gone wrong?

I expect your answers. I hv been trying since yesterday evening. But, I still haven't succeeded.

I googled a lot. I came across some. I hope this url is useful.

https://en.wikibooks.org/wiki/Perl_Programming/Unicode_UTF-8

2018-07-11 Athanasius added code tags to maillog quote and linkified the Wikibooks link