need help in parsing mime subject perl -
i managed emails gmail subject contains utf-8 characters ,
subject: =?utf-8?b?5l2g5aw9ios9oowlvq==?=
i searched interent found encoded quoted-printable
i tried using shown code decode subject
use mime::quotedprint; print decode_qp("?utf-8?b?5l2g5aw9ios9oowlvq==?=");
but prints same message , tried removing ?utf-8?
no use, can 1 me in converting above subject utf-8 characters instead of encoding above
use encode::mime::header module, in
$ perl -mencode -le 'print encode::encode("utf8", \ encode::decode("mime-header", "=?utf-8?b?5l2g5aw9ios9oowlvq==?="))' 你好 你好
or
#! /usr/bin/env perl use v5.10.0; use strict; use warnings; use encode qw/ decode /; $subject = "=?utf-8?b?5l2g5aw9ios9oowlvq==?="; binmode stdout, ":encoding(utf-8)"; decode "mime-header", $subject;
Comments
Post a Comment