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


In reply to utf8 in perl by theravadamonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.