• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quoted-Printable Perl Module
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quoted-Printable Perl Module


  • Subject: Re: Quoted-Printable Perl Module
  • From: debt <email@hidden>
  • Date: Fri, 17 Mar 2017 08:23:31 -0700

Chris,

Will this work for you?  I haven’t worked with MIME before so I don’t know if the output is correct or not.

Marc

--------------------------

#!/usr/bin/env perl 

use 5.024;
use warnings;
use MIME::QuotedPrint;

my $text_input = q(
FIND/REPLACE:
~s/=E2=80=9D|=E2=80=9C/\"/g;
~s/=E2=80=98|=E2=80=99/\'/g;
~s/=E2=80=93/\--/g;
~s/=E2=80=A6/\.../g;
);

my $decoded_text = decode_text($text_input);
say $decoded_text;


sub decode_text {
    my $text = shift;
    my $decoded = '';
    local ($/) = undef;

    my @arr = split ' ', $text;
    foreach my $sub_str (@arr) {
        $decoded .= __decode($sub_str);
    }
    return $decoded;
}

sub __decode {
    my $text = shift;
    my $decoded;
    local ($/) = undef;

    $text =~ s/=\?.+?\?q\?(.*)\?=/$1/g;
    $text =~ s/_/ /g;
    $decoded = decode_qp($text);

  return $decoded;
}

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Quoted-Printable Perl Module
      • From: Christopher Stone <email@hidden>
References: 
 >Quoted-Printable Perl Module (From: Christopher Stone <email@hidden>)
 >Re: Quoted-Printable Perl Module (From: debt <email@hidden>)
 >Re: Quoted-Printable Perl Module (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Saving a New Document with PDFPenPro
  • Next by Date: Re: Quoted-Printable Perl Module
  • Previous by thread: Re: Quoted-Printable Perl Module
  • Next by thread: Re: Quoted-Printable Perl Module
  • Index(es):
    • Date
    • Thread