• 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: Christopher Stone <email@hidden>
  • Date: Fri, 17 Mar 2017 17:06:25 -0500

On Mar 17, 2017, at 10:23, debt <email@hidden> wrote:
Will this work for you?  I haven’t worked with MIME before so I don’t know if the output is correct or not.


Hey Marc,

Unfortunately that doesn't work.

Input text:

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;

Output text:

FIND/REPLACE:
~s/”|“/\"/g;
~s/‘|’/\'/g;
~s/–/\--/g;
~s/…/\.../g;

This part of an email from a forum that I need to parse.

(Although this part isn't what I need to grab - it's just a nice messy example of QP.)

You're producing this:

FIND/REPLACE:~s/”|“/\"/g;~s/‘|’/\'/g;~s/–/\--/g;~s/…/\.../g;

Although...  That looks like it's right except the EOLs have been chomped.

I didn't expect this to work, but it did.

#!/usr/bin/env perl -sw
use 5.024;
use MIME::QuotedPrint;

my $textInput = 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 $decodedText = decode_qp($textInput);
print $decodedText;

--
Take Care,
Chris

 _______________________________________________
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

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>)
 >Re: Quoted-Printable Perl Module (From: debt <email@hidden>)

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